BitWizard Wiki
wikidb
https://bitwizard.nl/wiki/index.php/Main_Page
MediaWiki 1.35.6
first-letter
Media
Special
Talk
User
User talk
BitWizard Wiki
BitWizard Wiki talk
File
File talk
MediaWiki
MediaWiki talk
Template
Template talk
Help
Help talk
Category
Category talk
Main Page
0
1
1
2011-08-09T14:56:50Z
MediaWiki default
0
wikitext
text/x-wiki
<big>'''MediaWiki has been successfully installed.'''</big>
Consult the [http://meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.
== Getting started ==
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]
bd962048d95fbb6b6b514885867811db20a5476b
2
1
2011-08-09T15:21:00Z
REW
2
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
409a1948eb33bce977849e32d4f9de51ec5ef885
3
2
2011-08-09T15:21:22Z
REW
2
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* usbio
7cf0241aa4cec112477fb44fafa2ae024be254a8
4
3
2011-08-09T15:21:35Z
REW
2
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[usbio]]
cf4a7d529f6f59d7f838c42529466fadca5a6821
37
4
2011-09-19T15:36:48Z
Rew
3
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[usbio]] (or multiio).
21dc20537767e6007308e4758497efd47a58545f
38
37
2011-09-21T13:34:14Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[usbio]] (or multiio).
* [[FTDI_ATmega]]
* [[Cyclone dev board]]
* [[USB-SATA powerswitch]]
7aabc00893cc732ed7512934dd357de6a2e31f94
39
38
2011-09-21T13:34:46Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[usbio]] (or multiio).
* [[usbbigmultio]]
* [[FTDI_ATmega]]
* [[Cyclone dev board]]
* [[USB-SATA powerswitch]]
6bc386a0cc1fc9dbcc98b0d9221874892f782e04
55
39
2011-09-23T13:48:21Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[usbio]] (or multiio).
* [[usbbigmultio]]
* [[FTDI_ATmega]]
* [[Cyclone dev board]]
* [[USB-SATA powerswitch]]
* [[USB-opto]]
354e3e00a58104a584c56f66e46d007cce4d6095
65
55
2011-09-28T14:34:25Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[usbio]] (or multiio).
* [[usbbigmultio]]
* [[FTDI_ATmega]]
* [[Cyclone dev board]]
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[FT245RL breakout board]]
725e6eeb76539fcfa2962c35def6e0972b46ddfd
73
65
2011-10-21T14:26:16Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[usbio]] (or multiio).
* [[usbbigmultio]]
* [[FTDI_ATmega]]
* [[Cyclone dev board]]
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
ae7d2f0f06382afa74f83c95fe2867a28e44e94c
Usbio kitt
0
3
27
2011-08-27T09:20:20Z
Rew
3
Created page with '== usbio Kitt == The usbio kitt is a sample program. It is very basic in that it only uses generic AVR IO ports and not the USB functions of the device. The source code can…'
wikitext
text/x-wiki
== usbio Kitt ==
The usbio kitt is a sample program.
It is very basic in that it only uses generic AVR IO ports and not the USB functions of the device.
The source code can be downloaded from http://prive.bitwizard.nl/kitt.tgz
1710638d5ccdbdde6a9760e7f309d0781b815b6a
28
27
2011-08-27T09:20:39Z
Rew
3
/* usbio Kitt */
wikitext
text/x-wiki
== usbio Kitt ==
The usbio kitt is a sample program. It runs on the usb_multio
It is very basic in that it only uses generic AVR IO ports and not the USB functions of the device.
The source code can be downloaded from http://prive.bitwizard.nl/kitt.tgz
c28c0bebd0e71faff8e270e6c1e34aaca35fd5e7
29
28
2011-08-27T09:21:09Z
Rew
3
/* usbio Kitt */
wikitext
text/x-wiki
== usbio Kitt ==
The usbio kitt is a sample program. It runs on the [[usbio]].
It is very basic in that it only uses generic AVR IO ports and not the USB functions of the device.
The source code can be downloaded from http://prive.bitwizard.nl/kitt.tgz
429069b4bb5832cae4801c6a630d3d86934f5091
33
29
2011-08-28T06:06:25Z
Rew
3
/* usbio Kitt */
wikitext
text/x-wiki
== usbio Kitt ==
The usbio kitt is a sample program. It runs on the [[usbio]].
It is very basic in that it only uses generic AVR IO ports and not the USB functions of the device. The board will not enumerate on the USB bus when this demo is loaded.
The source code can be downloaded from http://prive.bitwizard.nl/kitt.tgz
be1db65b42fd52ac2949dd3807359d2080ea0da1
Usbio ACM sample program
0
4
31
2011-08-27T09:45:35Z
Rew
3
Created page with '== usbio sample ACM program == The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board. …'
wikitext
text/x-wiki
== usbio sample ACM program ==
The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board.
Under Linux if you connect your usbio board when it is loaded with this program, you will get a /dev/ttyACM0 device.
Under windows you will have to follow the directions of the LUFA documentation which include downloading and using the INF file located: https://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/LUFA%20VirtualSerial.inf?r=1607
The LUFA explanation is here: http://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt?spec=svn1470&r=1470
Once you have the driver sorted, you can use any terminal program you like to connect with the board. I use "kermit" to communicate with serial devices like this. There are several other programs available, but I'm used to kermit. Under windows there is a program called hyperterm.
Once you connect to the device, you will be prompted with a welcome string and a prompt. You can use several commands:
=== s ===
if you type s<outputnumber> the output with that number will go high. Outputnumber is in hex. For usbio the output numbers go from 0 to f. For example s5 will turn on output 5.
=== c ===
if you type c<outputnumber> the output with that number will be cleared. For example: ce will clear output 14 (which is e in hex).
=== a ===
If you type a<output> <value> the output will be put in software pwm mode. Currently values 0...80 are supported (128 levels).
=== p ===
If you type p <output> <length> the output with that number will be pulsed for <length> ms. The length is of course in hex.
=== z ===
If you type "z" the board will reset into firmware-upload-mode.
8054369af80011c1e00c44769440d03ce9aa343c
32
31
2011-08-27T09:48:28Z
Rew
3
/* usbio sample ACM program */
wikitext
text/x-wiki
== usbio sample ACM program ==
The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board.
Under Linux if you connect your usbio board when it is loaded with this program, you will get a /dev/ttyACM0 device.
Under windows you will have to follow the directions of the LUFA documentation which include downloading and using the INF file located: https://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/LUFA%20VirtualSerial.inf?r=1607
The LUFA explanation is here: http://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt?spec=svn1470&r=1470
Once you have the driver sorted, you can use any terminal program you like to connect with the board. I use "kermit" to communicate with serial devices like this. There are several other programs available, but I'm used to kermit. Under windows there is a program called hyperterm.
Once you connect to the device, you will be prompted with a welcome string and a prompt. You can use several commands:
=== s ===
if you type s<outputnumber> the output with that number will go high. Outputnumber is in hex. For usbio the output numbers go from 0 to f. For example s5 will turn on output 5.
=== c ===
if you type c<outputnumber> the output with that number will be cleared. For example: ce will clear output 14 (which is e in hex).
=== a ===
If you type a<output> <value> the output will be put in software pwm mode. Currently values 0...80 are supported (128 levels).
=== p ===
If you type p <output> <length> the output with that number will be pulsed for <length> ms. The length is of course in hex.
=== z ===
If you type "z" the board will reset into firmware-upload-mode.
== future enhancements ==
In the future we'll enhance the program to allow setting the mode of pins to inputs. And the program should be able to monitor the inputs value, and report the state changes as they happen. Also on-demand questioning of the inputs should become possible.
551b50fa4259654e7d7e52c1523ad56ebb1a40a8
34
32
2011-08-29T14:25:25Z
Rew
3
/* future enhancements */
wikitext
text/x-wiki
== usbio sample ACM program ==
The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board.
Under Linux if you connect your usbio board when it is loaded with this program, you will get a /dev/ttyACM0 device.
Under windows you will have to follow the directions of the LUFA documentation which include downloading and using the INF file located: https://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/LUFA%20VirtualSerial.inf?r=1607
The LUFA explanation is here: http://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt?spec=svn1470&r=1470
Once you have the driver sorted, you can use any terminal program you like to connect with the board. I use "kermit" to communicate with serial devices like this. There are several other programs available, but I'm used to kermit. Under windows there is a program called hyperterm.
Once you connect to the device, you will be prompted with a welcome string and a prompt. You can use several commands:
=== s ===
if you type s<outputnumber> the output with that number will go high. Outputnumber is in hex. For usbio the output numbers go from 0 to f. For example s5 will turn on output 5.
=== c ===
if you type c<outputnumber> the output with that number will be cleared. For example: ce will clear output 14 (which is e in hex).
=== a ===
If you type a<output> <value> the output will be put in software pwm mode. Currently values 0...80 are supported (128 levels).
=== p ===
If you type p <output> <length> the output with that number will be pulsed for <length> ms. The length is of course in hex.
=== z ===
If you type "z" the board will reset into firmware-upload-mode.
== download ==
You can download the source from: http://prive.bitwizard.nl/usbio.tgz
You then need to download LUFA, and place it in the directory usbio/../LUFA (i.e. next to the usbio directory).
== future enhancements ==
In the future we'll enhance the program to allow setting the mode of pins to inputs. And the program should be able to monitor the inputs value, and report the state changes as they happen. Also on-demand questioning of the inputs should become possible.
717cbc7376444cceeef9d03cf8bc73b301d6fec9
Usbbigmultio
0
5
40
2011-09-21T13:47:49Z
Tom
4
Created page with '= USB IO = This is the documentation page for the USBbigmultio PCB. == overview == The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the P…'
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0</td></tr>
<tr><td>4</td><td>PB1</td></tr>
<tr><td>5</td><td>PB2</td></tr>
<tr><td>6</td><td>PB3</td></tr>
<tr><td>7</td><td>PB4</td></tr>
<tr><td>8</td><td>PB5</td></tr>
<tr><td>9</td><td>PB6</td></tr>
<tr><td>10</td><td>PB7</td></tr>
<tr><td>11</td><td>PD0</td></tr>
<tr><td>12</td><td>DP1</td></tr>
<tr><td>13</td><td>PD2</td></tr>
<tr><td>14</td><td>PD3</td></tr>
<tr><td>15</td><td>PD4</td></tr>
<tr><td>16</td><td>PD5</td></tr>
<tr><td>17</td><td>PD6</td></tr>
<tr><td>18</td><td>PD7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6</td></tr>
<tr><td>4</td><td>PC7</td></tr>
<tr><td>5</td><td>PE2</td></tr>
<tr><td>6</td><td>PE6</td></tr>
<tr><td>7</td><td>PF0</td></tr>
<tr><td>8</td><td>PF1</td></tr>
<tr><td>9</td><td>PF4</td></tr>
<tr><td>10</td><td>PF5</td></tr>
<tr><td>11</td><td>PF6</td></tr>
<tr><td>12</td><td>PF7</td></tr>
<tr><td>13</td><td>PF1</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* allow external reset by providing a header parallel to the onboard switch.
* Make an ICSP connector.
* Allow the board to work as ICSP programmer through the ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
9b7246d5a32e1c90c31786db98f35527fdbedf71
43
40
2011-09-21T14:17:43Z
Tom
4
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0</td></tr>
<tr><td>4</td><td>PB1</td></tr>
<tr><td>5</td><td>PB2</td></tr>
<tr><td>6</td><td>PB3</td></tr>
<tr><td>7</td><td>PB4</td></tr>
<tr><td>8</td><td>PB5</td></tr>
<tr><td>9</td><td>PB6</td></tr>
<tr><td>10</td><td>PB7</td></tr>
<tr><td>11</td><td>PD0</td></tr>
<tr><td>12</td><td>DP1</td></tr>
<tr><td>13</td><td>PD2</td></tr>
<tr><td>14</td><td>PD3</td></tr>
<tr><td>15</td><td>PD4</td></tr>
<tr><td>16</td><td>PD5</td></tr>
<tr><td>17</td><td>PD6</td></tr>
<tr><td>18</td><td>PD7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6</td></tr>
<tr><td>4</td><td>PC7</td></tr>
<tr><td>5</td><td>PE2</td></tr>
<tr><td>6</td><td>PE6</td></tr>
<tr><td>7</td><td>PF0</td></tr>
<tr><td>8</td><td>PF1</td></tr>
<tr><td>9</td><td>PF4</td></tr>
<tr><td>10</td><td>PF5</td></tr>
<tr><td>11</td><td>PF6</td></tr>
<tr><td>12</td><td>PF7</td></tr>
<tr><td>13</td><td>PF1</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* allow external reset by providing a header parallel to the onboard switch.
* Make an ICSP connector.
* Allow the board to work as ICSP programmer through the ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
07dc1128fcffa1c039f95b16af6b688c7d168435
FTDI ATmega
0
6
41
2011-09-21T14:16:19Z
Tom
4
Created page with '= FTDI-atmega = This is the documentation page for the FTDI-atmega PCB. == overview == The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the P…'
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to CBUS0 (FT232RL)
* led3 is connected to CBUS1 (FT232RL)
* led4 is connected to PC5
* led5 is connected to PC4
=== windows ===
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
== future software enhancements ==
f00bf440b617eab16f574b81746e12f0189f0cac
44
41
2011-09-21T14:18:05Z
Tom
4
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to CBUS0 (FT232RL)
* led3 is connected to CBUS1 (FT232RL)
* led4 is connected to PC5
* led5 is connected to PC4
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
== future software enhancements ==
bbd49e6c34c6af83390e899f574185227b0a3b54
48
44
2011-09-21T14:56:31Z
Rew
3
/* Linux */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to CBUS0 (FT232RL)
* led3 is connected to CBUS1 (FT232RL)
* led4 is connected to PC5
* led5 is connected to PC4
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
== future software enhancements ==
f842126999e31d3c2e9a6700f84f1402c0eb88e6
49
48
2011-09-21T14:56:46Z
Rew
3
/* windows */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to CBUS0 (FT232RL)
* led3 is connected to CBUS1 (FT232RL)
* led4 is connected to PC5
* led5 is connected to PC4
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linus section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
== future software enhancements ==
ff5f53fcc792e740d05d64f452b0d5bca9c09497
50
49
2011-09-21T14:56:55Z
Rew
3
/* windows */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to CBUS0 (FT232RL)
* led3 is connected to CBUS1 (FT232RL)
* led4 is connected to PC5
* led5 is connected to PC4
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
== future software enhancements ==
c8571e11db3e9ba23de1b665abdbdffaf9b705e4
51
50
2011-09-21T14:58:22Z
Rew
3
/* future hardware enhancements */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to CBUS0 (FT232RL)
* led3 is connected to CBUS1 (FT232RL)
* led4 is connected to PC5
* led5 is connected to PC4
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
07f35aaf06a4e8ebda63c1f46ae8581054b6ed07
54
51
2011-09-21T15:51:01Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
025d24b9033c5e63d2bbf68abeb64237d19fcea5
USB-SATA powerswitch
0
7
45
2011-09-21T14:44:23Z
Tom
4
Created page with '= USB SATA powerswitch = This is the documentation page for the USB SATA powerswitch PCB. == overview == The USB SATA powerswitch PCB has an USB connector and connection poin…'
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lover side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
0ae2fa31e53cabf517685fa0884b11c0d7c67a88
46
45
2011-09-21T14:45:13Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
80bef436d6d371cd6ef25977d89695569c5c508b
47
46
2011-09-21T14:46:20Z
Tom
4
/* overview */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
be145775bd2f176d6478434421d0d744c852e6dd
52
47
2011-09-21T15:28:01Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
eb0c4552558a5249d8719f455924c44ff9daa09a
53
52
2011-09-21T15:48:53Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
be145775bd2f176d6478434421d0d744c852e6dd
64
53
2011-09-23T17:37:07Z
Tom
4
/* future software enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
* Add a function to read-out the current state of the outputs
bbbc38b259979fadd4e6f22c76039c5d25664574
USB-opto
0
8
56
2011-09-23T13:55:21Z
Tom
4
Created page with '= USB-opto = This is the documentation page for the USB-opto PCB. == overview == The USB-opto PCB has an USB connector and two 20-pin connectors. The brains of the PCB is an …'
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
== overview ==
The USB-opto PCB has an USB connector and two 20-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
The 20 pin connectors is connected as follows
<table border=1>
<tr><td>1</td><td></td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td></td></tr>
<tr><td>20</td><td></td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* rx PC5
* tx PC4
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
387c8c2ff9cac95d343ec4fb3390470df6193262
57
56
2011-09-23T13:55:50Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
== overview ==
The USB-opto PCB has an USB connector and two 20-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
The 20 pin connectors is connected as follows
<table border=1>
<tr><td>1</td><td></td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td></td></tr>
<tr><td>20</td><td></td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
f47562b22864348719935a1b2d0e8dd35b8193c5
58
57
2011-09-23T13:58:19Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
== overview ==
The USB-opto PCB has an USB connector and two 20-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
The 16 pin connectors is connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector optO 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector optO 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector optO 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector optO 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector optO 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector optO 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector optO 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector optO 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
d0d6cf8bc80b403d0323b0debb7961ef59d20912
59
58
2011-09-23T13:58:37Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
== overview ==
The USB-opto PCB has an USB connector and two 20-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
The 16 pin connectors is connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
1eae1a3acb896c1f7208c8406e0179720fe5d063
60
59
2011-09-23T13:58:59Z
Tom
4
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
== overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
f3f8a329c42e816d564ac6aa2abb9b3e7cb4081e
Cyclone dev board
0
9
61
2011-09-23T14:19:25Z
Tom
4
Created page with '= Cyclone dev board = This is the documentation page for the Cyclone dev board. == overview == The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brain…'
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
== future software enhancements ==
119db29cfb2880bb5fee56d0ee34145c68db4175
62
61
2011-09-23T14:38:56Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
== future software enhancements ==
b50b9e6863f5622b62548b8aac56f39d8f595e3d
63
62
2011-09-23T16:34:42Z
Tom
4
/* future hardware enhancements */
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
6b6170155d0d76e795f5272272950ef3563eb39a
67
63
2011-09-28T15:27:18Z
Tom
4
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
f4f7a710fce5ec3a1cbe7131f858fe7659937eab
68
67
2011-09-28T15:28:48Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
JP1: 5V power supply selection
1-2 5V from USB
3-4 5V from wall-wart powered regulator
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
2e6a834e914bd1a0a87ff62abba23f70779a5f44
69
68
2011-09-28T15:29:05Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
JP1: 5V power supply selection<br>
1-2 5V from USB<br>
3-4 5V from wall-wart powered regulator<br>
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
926a3d9f7459cb5841f92a06c007e2c32e13c7a6
70
69
2011-09-28T15:31:41Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV5
<table border=1>
<tr><td>1</td><td>3V3</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>CLK3</td></tr>
<tr><td>4</td><td>CLK2</td></tr>
<tr><td>5</td><td>CLK1</td></tr>
<tr><td>6</td><td>CLK0</td></tr>
</table>
SV6
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>VCCINT</td></tr>
<tr><td>3</td><td>3V3</td></tr>
<tr><td>4</td><td>5V</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
JP1: 5V power supply selection<br>
1-2 5V from USB<br>
3-4 5V from wall-wart powered regulator<br>
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
1d0ec3d285d98a02d42f084cdf28b6c5b694bab9
71
70
2011-09-28T15:32:52Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV5
<table border=1>
<tr><td>1</td><td>3V3</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>CLK3</td></tr>
<tr><td>4</td><td>CLK2</td></tr>
<tr><td>5</td><td>CLK1</td></tr>
<tr><td>6</td><td>CLK0</td></tr>
</table>
SV6
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>VCCINT</td></tr>
<tr><td>3</td><td>3V3</td></tr>
<tr><td>4</td><td>5V</td></tr>
</table>
JP2
<table border=1>
<tr><td>1</td><td>EXT_RESET</td></tr>
<tr><td>2</td><td>GND</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
JP1: 5V power supply selection<br>
1-2 5V from USB<br>
3-4 5V from wall-wart powered regulator<br>
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
05ca5b1ac399e9e482d505c4f1de6b3f8a95658d
FT245RL breakout board
0
10
66
2011-09-28T14:44:36Z
Tom
4
Created page with '= FT245RL breakout board = This is the documentation page for the FT245RL breakout board. == overview == The FT245RL breakout board has an USB connector and a 20-pin IO conne…'
wikitext
text/x-wiki
= FT245RL breakout board =
This is the documentation page for the FT245RL breakout board.
== overview ==
The FT245RL breakout board has an USB connector and a 20-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>D1</td></tr>
<tr><td>4</td><td>D5</td></tr>
<tr><td>5</td><td>D2</td></tr>
<tr><td>6</td><td>D7</td></tr>
<tr><td>7</td><td>D0</td></tr>
<tr><td>8</td><td>D4</td></tr>
<tr><td>9</td><td>D3</td></tr>
<tr><td>10</td><td>D6</td></tr>
<tr><td>11</td><td>WR</td></tr>
<tr><td>12</td><td>RD#</td></tr>
<tr><td>13</td><td>RXF</td></tr>
<tr><td>14</td><td>TXE#</td></tr>
<tr><td>15</td><td>NC</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>NC</td></tr>
<tr><td>18</td><td>NC</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 (near the bottom) is connected to VCC
== Jumper settings ==
IO and supply voltage to 20-pin connector<br>
1-2: 3V3<br>
2-3: 5V<br>
== future hardware enhancements ==
05d875dd0330867fb4b2284f73a13cf03124eccf
Odd
0
11
72
2011-09-30T05:30:05Z
Rew
3
Created page with ' == One Down Delft == * [[bedienen schudmachine]] * [[afsluiten van een avond]] (met spelverdelingen)'
wikitext
text/x-wiki
== One Down Delft ==
* [[bedienen schudmachine]]
* [[afsluiten van een avond]] (met spelverdelingen)
a4ad67f62b6a225f1cd5aa1db3fc18b18018eba4
FT2232H breakout board
0
12
74
2011-10-21T14:29:36Z
Tom
4
Created page with '= FT2232H breakout board = This is the documentation page for the FT2232H breakout board. == overview == The FT2232H breakout board has an USB connector, two 20-pin HDR-stand…'
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors, and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
<tr><td>21</td><td>GND</td></tr>
<tr><td>22</td><td>GND</td></tr>
<tr><td>23</td><td></td></tr>
<tr><td>24</td><td></td></tr>
<tr><td>25</td><td></td></tr>
<tr><td>26</td><td></td></tr>
<tr><td>27</td><td></td></tr>
<tr><td>28</td><td></td></tr>
<tr><td>29</td><td></td></tr>
<tr><td>30</td><td></td></tr>
<tr><td>31</td><td></td></tr>
<tr><td>32</td><td></td></tr>
<tr><td>33</td><td></td></tr>
<tr><td>34</td><td></td></tr>
<tr><td>35</td><td></td></tr>
<tr><td>36</td><td></td></tr>
<tr><td>37</td><td></td></tr>
<tr><td>38</td><td></td></tr>
<tr><td>39</td><td>VCC</td></tr>
<tr><td>40</td><td>VCC</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
== future hardware enhancements ==
a4cc4b20e28696cde92533913635b6579863d2f1
75
74
2011-10-21T14:30:17Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors, and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td></td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td></td></tr>
<tr><td>20</td><td></td></tr>
<tr><td>21</td><td></td></tr>
<tr><td>22</td><td></td></tr>
<tr><td>23</td><td></td></tr>
<tr><td>24</td><td></td></tr>
<tr><td>25</td><td></td></tr>
<tr><td>26</td><td></td></tr>
<tr><td>27</td><td></td></tr>
<tr><td>28</td><td></td></tr>
<tr><td>29</td><td></td></tr>
<tr><td>30</td><td></td></tr>
<tr><td>31</td><td></td></tr>
<tr><td>32</td><td></td></tr>
<tr><td>33</td><td></td></tr>
<tr><td>34</td><td></td></tr>
<tr><td>35</td><td></td></tr>
<tr><td>36</td><td></td></tr>
<tr><td>37</td><td></td></tr>
<tr><td>38</td><td></td></tr>
<tr><td>39</td><td></td></tr>
<tr><td>40</td><td></td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
== future hardware enhancements ==
f883d0d249a0a74780daaba46c86a27dbb665382
76
75
2011-10-21T14:31:00Z
Tom
4
/* overview */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td></td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td></td></tr>
<tr><td>20</td><td></td></tr>
<tr><td>21</td><td></td></tr>
<tr><td>22</td><td></td></tr>
<tr><td>23</td><td></td></tr>
<tr><td>24</td><td></td></tr>
<tr><td>25</td><td></td></tr>
<tr><td>26</td><td></td></tr>
<tr><td>27</td><td></td></tr>
<tr><td>28</td><td></td></tr>
<tr><td>29</td><td></td></tr>
<tr><td>30</td><td></td></tr>
<tr><td>31</td><td></td></tr>
<tr><td>32</td><td></td></tr>
<tr><td>33</td><td></td></tr>
<tr><td>34</td><td></td></tr>
<tr><td>35</td><td></td></tr>
<tr><td>36</td><td></td></tr>
<tr><td>37</td><td></td></tr>
<tr><td>38</td><td></td></tr>
<tr><td>39</td><td></td></tr>
<tr><td>40</td><td></td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
== future hardware enhancements ==
46a4cf9695c99bc6c19474458373d85f5b4d3672
FT2232H breakout board
0
12
77
76
2011-10-21T14:32:11Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td></td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td>V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td></td></tr>
<tr><td>20</td><td></td></tr>
<tr><td>21</td><td></td></tr>
<tr><td>22</td><td></td></tr>
<tr><td>23</td><td></td></tr>
<tr><td>24</td><td></td></tr>
<tr><td>25</td><td></td></tr>
<tr><td>26</td><td></td></tr>
<tr><td>27</td><td></td></tr>
<tr><td>28</td><td></td></tr>
<tr><td>29</td><td>V</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td></td></tr>
<tr><td>32</td><td></td></tr>
<tr><td>33</td><td></td></tr>
<tr><td>34</td><td></td></tr>
<tr><td>35</td><td></td></tr>
<tr><td>36</td><td></td></tr>
<tr><td>37</td><td></td></tr>
<tr><td>38</td><td></td></tr>
<tr><td>39</td><td></td></tr>
<tr><td>40</td><td></td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
== future hardware enhancements ==
67cc87eac36c93b777bfeba3933212199bf9be19
78
77
2011-10-21T14:33:37Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td></td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td>V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td></td></tr>
<tr><td>20</td><td></td></tr>
<tr><td>21</td><td></td></tr>
<tr><td>22</td><td></td></tr>
<tr><td>23</td><td></td></tr>
<tr><td>24</td><td></td></tr>
<tr><td>25</td><td></td></tr>
<tr><td>26</td><td></td></tr>
<tr><td>27</td><td></td></tr>
<tr><td>28</td><td></td></tr>
<tr><td>29</td><td>V</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td></td></tr>
<tr><td>32</td><td></td></tr>
<tr><td>33</td><td></td></tr>
<tr><td>34</td><td></td></tr>
<tr><td>35</td><td></td></tr>
<tr><td>36</td><td></td></tr>
<tr><td>37</td><td></td></tr>
<tr><td>38</td><td></td></tr>
<tr><td>39</td><td></td></tr>
<tr><td>40</td><td></td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td></td></tr>
<tr><td>12</td><td></td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
== future hardware enhancements ==
5d398d649208788de10d7f2b261ab4b1be4e5a7d
79
78
2011-10-21T14:34:26Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td></td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td></td></tr>
<tr><td>6</td><td></td></tr>
<tr><td>7</td><td></td></tr>
<tr><td>8</td><td></td></tr>
<tr><td>9</td><td></td></tr>
<tr><td>10</td><td></td></tr>
<tr><td>11</td><td>V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td></td></tr>
<tr><td>14</td><td></td></tr>
<tr><td>15</td><td></td></tr>
<tr><td>16</td><td></td></tr>
<tr><td>17</td><td></td></tr>
<tr><td>18</td><td></td></tr>
<tr><td>19</td><td></td></tr>
<tr><td>20</td><td></td></tr>
<tr><td>21</td><td></td></tr>
<tr><td>22</td><td></td></tr>
<tr><td>23</td><td></td></tr>
<tr><td>24</td><td></td></tr>
<tr><td>25</td><td></td></tr>
<tr><td>26</td><td></td></tr>
<tr><td>27</td><td></td></tr>
<tr><td>28</td><td></td></tr>
<tr><td>29</td><td>V</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td></td></tr>
<tr><td>32</td><td></td></tr>
<tr><td>33</td><td></td></tr>
<tr><td>34</td><td></td></tr>
<tr><td>35</td><td></td></tr>
<tr><td>36</td><td></td></tr>
<tr><td>37</td><td></td></tr>
<tr><td>38</td><td></td></tr>
<tr><td>39</td><td></td></tr>
<tr><td>40</td><td></td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
== future hardware enhancements ==
0aab884da85dee0067427c3fabdde37d284cd334
80
79
2011-10-21T14:38:37Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
== future hardware enhancements ==
236ef9ff35bca034d4d20db1d6da669853a8e963
81
80
2011-10-21T14:46:13Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection
1-2: Direct from FPGA board (through 40-pin connector)
2-3: From regulator (see SV3 settings)
SV3: Regulator power source selection
1-2: Powered from USB
2-3: Powered from FPGA board (through 40-pin connector)
== future hardware enhancements ==
fc2963f77fecd1e9c09cd9f5a84fa70113f032d6
82
81
2011-10-21T14:46:35Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td></td></tr>
<tr><td>3</td><td></td></tr>
<tr><td>4</td><td></td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection
1-2: Direct from FPGA board (through 40-pin connector)
2-3: From regulator (see SV3 settings)
SV3: Regulator power source selection
1-2: Powered from USB
2-3: Powered from FPGA board (through 40-pin connector)
== future hardware enhancements ==
f8d929c7312b5f692b2310d6b540611d7428364c
83
82
2011-10-21T14:49:19Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection
1-2: Direct from FPGA board (through 40-pin connector)
2-3: From regulator (see SV3 settings)
SV3: Regulator power source selection
1-2: Powered from USB
2-3: Powered from FPGA board (through 40-pin connector)
== future hardware enhancements ==
f4656359e385d541987686677cf96ba295023afd
98
83
2011-11-11T10:19:14Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
== future hardware enhancements ==
75adb6e8af778e515edb3e6c31c4aadda45278b8
127
98
2011-11-16T13:32:41Z
Tom
4
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
== future hardware enhancements ==
== Changelog ==
2.0
* Initial public release
486206617d675b4dac263a7fe05cf98bf83b4679
130
127
2011-11-25T12:51:51Z
Tom
4
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== Datasheets ==
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
== future hardware enhancements ==
== Changelog ==
2.0
* Initial public release
1302b91693bea59c8b24df7743eded8ebda44ad9
131
130
2011-11-25T12:57:30Z
Tom
4
/* Datasheets */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External pages ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
== future hardware enhancements ==
== Changelog ==
2.0
* Initial public release
d4edb95f843e940f4446e6ac6f7c620aa30d88c6
132
131
2011-11-25T14:01:18Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External pages ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
59e6d5cbd122529293e1d09a724df6a567b57e0e
133
132
2011-11-25T14:03:08Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External pages ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection<br> (physical position is the same as in 2.0, only numbering has changed)
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
a812d44f7890016b2c7f057f0f3c055950c53822
134
133
2011-11-25T14:03:38Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External pages ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
f0fad877b4510776569a7f5e972e37ac3a55ea4c
135
134
2011-11-25T14:04:07Z
Tom
4
/* External pages */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
379a39efca48c74b927ed20639b9be53737b65c0
Main Page
0
1
84
73
2011-10-31T12:15:42Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[8 FETs]]
* [[FTDI_ATmega]]
* [[usbio]] (or multiio).
* [[usbbigmultio]]
* [[USB-SATA powerswitch]]
* [[FTDI serial]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Servotester]]
* [[AVR Bigmega]]
* [[USB-opto]]
* [[Digital potentiometer]]
* [[Cyclone dev board]]
* [[16 LEDs]]
* [[Two-wire LCD interface]]
* [[Two-wire servo interface]]
* [[Two-wire LM35/thermocouple interface]]
2723a204c51b618e9df1be379783d6376c3015e0
Two-wire servo interface
0
13
85
2011-10-31T12:32:46Z
Tom
4
Created page with '= Two-wire servo interface = This is the documentation page for the Two-wire servo interface PCB. == overview == == pinout == == future hardware enhancements == * Add e…'
wikitext
text/x-wiki
= Two-wire servo interface =
This is the documentation page for the Two-wire servo interface PCB.
== overview ==
== pinout ==
== future hardware enhancements ==
* Add extra power connector for servo power
== future software enhancements ==
db82b25fdfa5b4defbdae684b016d275a28fb5b1
Two-wire LM35/thermocouple interface
0
14
86
2011-10-31T13:09:05Z
Tom
4
Created page with '= Two-wire LM35/thermocouple interface = This is the documentation page for the Two-wire LM35/thermocouple interface PCB. == overview == == pinout == == future hardware …'
wikitext
text/x-wiki
= Two-wire LM35/thermocouple interface =
This is the documentation page for the Two-wire LM35/thermocouple interface PCB.
== overview ==
== pinout ==
== future hardware enhancements ==
== future software enhancements ==
ea35e132b24ee6896a11051b4d7e3487c082628d
Usbbigmultio
0
5
99
43
2011-11-11T10:28:07Z
Tom
4
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0</td></tr>
<tr><td>4</td><td>PB1</td></tr>
<tr><td>5</td><td>PB2</td></tr>
<tr><td>6</td><td>PB3</td></tr>
<tr><td>7</td><td>PB4</td></tr>
<tr><td>8</td><td>PB5</td></tr>
<tr><td>9</td><td>PB6</td></tr>
<tr><td>10</td><td>PB7</td></tr>
<tr><td>11</td><td>PD0</td></tr>
<tr><td>12</td><td>DP1</td></tr>
<tr><td>13</td><td>PD2</td></tr>
<tr><td>14</td><td>PD3</td></tr>
<tr><td>15</td><td>PD4</td></tr>
<tr><td>16</td><td>PD5</td></tr>
<tr><td>17</td><td>PD6</td></tr>
<tr><td>18</td><td>PD7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6</td></tr>
<tr><td>4</td><td>PC7</td></tr>
<tr><td>5</td><td>PE2</td></tr>
<tr><td>6</td><td>PE6</td></tr>
<tr><td>7</td><td>PF0</td></tr>
<tr><td>8</td><td>PF1</td></tr>
<tr><td>9</td><td>PF4</td></tr>
<tr><td>10</td><td>PF5</td></tr>
<tr><td>11</td><td>PF6</td></tr>
<tr><td>12</td><td>PF7</td></tr>
<tr><td>13</td><td>PF1</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* allow external reset by providing a header parallel to the onboard switch.
* Make an ICSP connector.
* Allow the board to work as ICSP programmer through the ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.0
* Initial release
071b05df835f65e8f9b67a8adbff985270bd792e
100
99
2011-11-11T10:45:36Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0</td></tr>
<tr><td>4</td><td>PB1</td></tr>
<tr><td>5</td><td>PB2</td></tr>
<tr><td>6</td><td>PB3</td></tr>
<tr><td>7</td><td>PB4</td></tr>
<tr><td>8</td><td>PB5</td></tr>
<tr><td>9</td><td>PB6</td></tr>
<tr><td>10</td><td>PB7</td></tr>
<tr><td>11</td><td>PD0</td></tr>
<tr><td>12</td><td>DP1</td></tr>
<tr><td>13</td><td>PD2</td></tr>
<tr><td>14</td><td>PD3</td></tr>
<tr><td>15</td><td>PD4</td></tr>
<tr><td>16</td><td>PD5</td></tr>
<tr><td>17</td><td>PD6</td></tr>
<tr><td>18</td><td>PD7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6</td></tr>
<tr><td>4</td><td>PC7</td></tr>
<tr><td>5</td><td>PE2</td></tr>
<tr><td>6</td><td>PE6</td></tr>
<tr><td>7</td><td>PF0</td></tr>
<tr><td>8</td><td>PF1</td></tr>
<tr><td>9</td><td>PF4</td></tr>
<tr><td>10</td><td>PF5</td></tr>
<tr><td>11</td><td>PF6</td></tr>
<tr><td>12</td><td>PF7</td></tr>
<tr><td>13</td><td>PF1</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* allow external reset by providing a header parallel to the onboard switch.
* Make an ICSP connector.
* Allow the board to work as ICSP programmer through the ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
2ce3c64630799c14ff3132fba7e283834d6bf570
101
100
2011-11-11T10:45:48Z
Tom
4
/* future hardware enhancements */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0</td></tr>
<tr><td>4</td><td>PB1</td></tr>
<tr><td>5</td><td>PB2</td></tr>
<tr><td>6</td><td>PB3</td></tr>
<tr><td>7</td><td>PB4</td></tr>
<tr><td>8</td><td>PB5</td></tr>
<tr><td>9</td><td>PB6</td></tr>
<tr><td>10</td><td>PB7</td></tr>
<tr><td>11</td><td>PD0</td></tr>
<tr><td>12</td><td>DP1</td></tr>
<tr><td>13</td><td>PD2</td></tr>
<tr><td>14</td><td>PD3</td></tr>
<tr><td>15</td><td>PD4</td></tr>
<tr><td>16</td><td>PD5</td></tr>
<tr><td>17</td><td>PD6</td></tr>
<tr><td>18</td><td>PD7</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6</td></tr>
<tr><td>4</td><td>PC7</td></tr>
<tr><td>5</td><td>PE2</td></tr>
<tr><td>6</td><td>PE6</td></tr>
<tr><td>7</td><td>PF0</td></tr>
<tr><td>8</td><td>PF1</td></tr>
<tr><td>9</td><td>PF4</td></tr>
<tr><td>10</td><td>PF5</td></tr>
<tr><td>11</td><td>PF6</td></tr>
<tr><td>12</td><td>PF7</td></tr>
<tr><td>13</td><td>PF1</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
8fdfe7a976ee82fa1c3c0b54267692d5d29b08bc
103
101
2011-11-11T11:33:42Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
3948f72e6000abc566498b73f2c09e77a4760fcc
105
103
2011-11-11T14:14:23Z
Tom
4
/* future hardware enhancements */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
2f7f5c125edd68bb86910f68432b02f8bed91173
138
105
2011-11-25T14:04:46Z
Tom
4
/* overview */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== External resources ==
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
3e5b2b6af108b890d2c698a2780854dfb52336f5
FTDI serial
0
19
106
2011-11-11T14:25:27Z
Tom
4
Created page with '= FTDI-serial board = This is the documentation page for the FTDI-serial board. == overview == The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. T…'
wikitext
text/x-wiki
= FTDI-serial board =
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
1c3944d293e39bf15b138d80f293702615d0cfa4
124
106
2011-11-16T13:30:48Z
Tom
4
wikitext
text/x-wiki
= FTDI-serial board =
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
1.0
* Initial public release
1a16717c41ebda79f1e958c12fefa9ade960a652
140
124
2011-11-25T14:04:56Z
Tom
4
/* overview */
wikitext
text/x-wiki
= FTDI-serial board =
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
1.0
* Initial public release
98ec470087d8ff3f3a820146b99cce340765eaf2
USB-SATA powerswitch
0
7
107
64
2011-11-14T13:21:03Z
Rew
3
/* future software enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
46fc0f9b944a1653e786daccc7f538d845865b8b
108
107
2011-11-14T13:27:34Z
Rew
3
/* future hardware enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
== future software enhancements ==
* program the LUFA bootloader.
e6941fc2073d11e26efd2ebd883e4abb5e8e88db
109
108
2011-11-14T14:47:02Z
Tom
4
/* future hardware enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
3b0f5d29dcec1b67a06984f4575b2a20654cce34
110
109
2011-11-14T14:55:38Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
[code]
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
[/code]
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, it may (or will) freeze.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
94f0b4549afda5532931f8b511eb2fc32bb0636c
111
110
2011-11-14T14:55:51Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, it may (or will) freeze.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
99fdc451d733c55cdeebc4ae53b9f959d652caea
113
111
2011-11-14T15:36:32Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, it may (or will) freeze.
The devices are shipped with the following .hex file programmed:
[[file:Usb-sata_powerswitch.hex]]
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
083dbfba6b1ea71cef593c03055bbd637db6b21f
114
113
2011-11-14T15:36:42Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, it may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
bc56cfb63cf51f600bebfe6538b453d29f07025a
115
114
2011-11-14T15:37:40Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, it may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
3f3fa35fcdf942052e9fcac615ec6fb3cb20691b
116
115
2011-11-14T15:37:57Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
77e350569e427c8dddaaf4bea8ae088bbec826ac
118
116
2011-11-14T16:06:02Z
Tom
4
/* future software enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1
* Initial release
3e49fdf0a78092f0b84bb61f2ef1d7e49dd3c031
119
118
2011-11-14T16:07:22Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT
* 12V IN
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
1
* Initial release
596ae685810730197e48f6dc57ff622e1d77c710
120
119
2011-11-14T16:08:25Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* replace the SMD switch with an TH version
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
1
* Initial release
04ed43e41623313641c5ffd3ff27bb400f13723b
121
120
2011-11-14T16:09:37Z
Tom
4
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
1
* Initial release
28e5515d993bda2604a819068d3dfea2f7db0c2f
122
121
2011-11-14T16:57:02Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Add mounting holes
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
ec8960edab0c48c1a1e9395b1d0acde2c064fd9e
123
122
2011-11-14T16:57:10Z
Tom
4
/* future hardware enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
85291caa22b47455a1ae19f063536789d7558aca
139
123
2011-11-25T14:04:51Z
Tom
4
/* overview */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
7251dc39181acd38a4045aa188b26bbb268196a8
File:Usb-sata powerswitch.hex
6
20
112
2011-11-14T15:33:39Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
FTDI ATmega
0
6
125
54
2011-11-16T13:31:44Z
Tom
4
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
f3a320f8c7d8228debd9bece2dac8efc7bf1cbd8
136
125
2011-11-25T14:04:31Z
Tom
4
/* overview */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
da32073035c9152629ce9e72cbd79ed0b9d16e52
FT245RL breakout board
0
10
126
66
2011-11-16T13:32:12Z
Tom
4
wikitext
text/x-wiki
= FT245RL breakout board =
This is the documentation page for the FT245RL breakout board.
== overview ==
The FT245RL breakout board has an USB connector and a 20-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>D1</td></tr>
<tr><td>4</td><td>D5</td></tr>
<tr><td>5</td><td>D2</td></tr>
<tr><td>6</td><td>D7</td></tr>
<tr><td>7</td><td>D0</td></tr>
<tr><td>8</td><td>D4</td></tr>
<tr><td>9</td><td>D3</td></tr>
<tr><td>10</td><td>D6</td></tr>
<tr><td>11</td><td>WR</td></tr>
<tr><td>12</td><td>RD#</td></tr>
<tr><td>13</td><td>RXF</td></tr>
<tr><td>14</td><td>TXE#</td></tr>
<tr><td>15</td><td>NC</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>NC</td></tr>
<tr><td>18</td><td>NC</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 (near the bottom) is connected to VCC
== Jumper settings ==
IO and supply voltage to 20-pin connector<br>
1-2: 3V3<br>
2-3: 5V<br>
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
c1756be77dd9068b7ffb10c5726bb92a2bc93c62
141
126
2011-11-25T14:05:01Z
Tom
4
/* overview */
wikitext
text/x-wiki
= FT245RL breakout board =
This is the documentation page for the FT245RL breakout board.
== overview ==
The FT245RL breakout board has an USB connector and a 20-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>D1</td></tr>
<tr><td>4</td><td>D5</td></tr>
<tr><td>5</td><td>D2</td></tr>
<tr><td>6</td><td>D7</td></tr>
<tr><td>7</td><td>D0</td></tr>
<tr><td>8</td><td>D4</td></tr>
<tr><td>9</td><td>D3</td></tr>
<tr><td>10</td><td>D6</td></tr>
<tr><td>11</td><td>WR</td></tr>
<tr><td>12</td><td>RD#</td></tr>
<tr><td>13</td><td>RXF</td></tr>
<tr><td>14</td><td>TXE#</td></tr>
<tr><td>15</td><td>NC</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>NC</td></tr>
<tr><td>18</td><td>NC</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 (near the bottom) is connected to VCC
== Jumper settings ==
IO and supply voltage to 20-pin connector<br>
1-2: 3V3<br>
2-3: 5V<br>
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
f3624a623ccb3098a04fb69d27e62cdb0ae8481d
USB-opto
0
8
128
60
2011-11-16T13:33:00Z
Tom
4
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
== overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
96f31b57f722a039196dc0a7d9236c7960de6eaf
Cyclone dev board
0
9
129
71
2011-11-16T13:33:25Z
Tom
4
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV5
<table border=1>
<tr><td>1</td><td>3V3</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>CLK3</td></tr>
<tr><td>4</td><td>CLK2</td></tr>
<tr><td>5</td><td>CLK1</td></tr>
<tr><td>6</td><td>CLK0</td></tr>
</table>
SV6
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>VCCINT</td></tr>
<tr><td>3</td><td>3V3</td></tr>
<tr><td>4</td><td>5V</td></tr>
</table>
JP2
<table border=1>
<tr><td>1</td><td>EXT_RESET</td></tr>
<tr><td>2</td><td>GND</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
JP1: 5V power supply selection<br>
1-2 5V from USB<br>
3-4 5V from wall-wart powered regulator<br>
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
== Changelog ==
4.1
* Initial public release
46cf1415b0fab6305f6ca753bdcc4007b73514a2
USB-opto
0
8
142
128
2011-11-25T14:05:09Z
Tom
4
/* overview */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
== overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
29b29a75debcfb1c9a352270e23f3550c71cb78a
Cyclone dev board
0
9
143
129
2011-11-25T14:05:14Z
Tom
4
/* overview */
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== External resources ==
== pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV5
<table border=1>
<tr><td>1</td><td>3V3</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>CLK3</td></tr>
<tr><td>4</td><td>CLK2</td></tr>
<tr><td>5</td><td>CLK1</td></tr>
<tr><td>6</td><td>CLK0</td></tr>
</table>
SV6
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>VCCINT</td></tr>
<tr><td>3</td><td>3V3</td></tr>
<tr><td>4</td><td>5V</td></tr>
</table>
JP2
<table border=1>
<tr><td>1</td><td>EXT_RESET</td></tr>
<tr><td>2</td><td>GND</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
JP1: 5V power supply selection<br>
1-2 5V from USB<br>
3-4 5V from wall-wart powered regulator<br>
== programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== windows ===
== writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== future hardware enhancements ==
* Update Mini-B footprint
== future software enhancements ==
== Changelog ==
4.1
* Initial public release
23e3d71bc67f3997402cdb13295ca8f8a7027b0b
Usbbigmultio
0
5
149
138
2011-12-07T12:53:42Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== External resources ==
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
8b4646491535f701891ba93e40620c32e8ae900c
151
149
2011-12-07T13:57:48Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== External resources ==
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
c34594fc46aa4e4da53a065f7fb7558f85ae9993
FTDI ATmega
0
6
156
136
2012-01-05T15:54:26Z
Rew
3
/* Linux */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
48181db00065e8cde4b38f26a25e77d2c0824bc1
157
156
2012-01-06T14:54:40Z
David
17
/* pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
Unlike a regular arduino, the onboard LED is connected to pin A4. This means pin 13 is free for regular use.
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
6ff4e80654ffdb5b84d37e0cd543e254d1358c43
158
157
2012-01-06T14:55:27Z
David
17
/* Arduino Pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
Unlike a regular arduino, the onboard LED is connected to pin A4. This means pin 13 is free for regular use.
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
59615be4e7d2bb0b0be4bf9b522813e7cee19fe9
159
158
2012-01-06T14:57:07Z
David
17
/* Arduino Pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
Unlike a regular arduino, the onboard LED is connected to pin A4. This means pin 13 is free for regular use.
Pin 0 and 1 are used for the COM interface like a regular arduino.
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
5ca5fe715c52ba7b635b4c4e0e3c4b4d6d2f4a0e
160
159
2012-01-06T14:58:11Z
David
17
/* Arduino Pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A4. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
fb8bbca1ebd35d0a0af68e0e799ec2e0e0bbf12d
161
160
2012-01-06T15:00:37Z
David
17
/* Arduino Pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
cbf102263e9ff223177c7fb29c11823abe1e39af
162
161
2012-01-06T20:50:39Z
David
17
/* Arduino Pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogOutput), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
8e7d614728198161862340de38d8357612e44724
163
162
2012-01-06T20:51:36Z
David
17
/* Arduino Pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
71eb63362bd8f4c366d895734edfb59376f69bc9
164
163
2012-01-09T13:35:27Z
Rew
3
/* Changelog */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
ee9db1c8688d7425eac3dc90f187f8f126291449
182
164
2012-01-11T12:25:47Z
JasmineClay
19
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor. The process of [http://www.marvelousessays.com essay writing] will be much easier with MarvelousEssays.Com as there are a lot of highly professional and talented writers who are always eager to help you out with any sort of academic assignments regardless of the complexity levels. I do know what I�m talking about!
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
fca0464cf2abd2d7695ad797fcfd738c7363c0ef
185
182
2012-01-12T13:00:07Z
Tom
4
Reverted edits by [[Special:Contributions/JasmineClay|JasmineClay]] ([[User talk:JasmineClay|Talk]]) to last revision by [[User:Rew|Rew]]
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB.
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
ee9db1c8688d7425eac3dc90f187f8f126291449
RGB clock
0
25
165
2012-01-09T16:21:42Z
Tom
4
Created page with '= RGB clock = This is the documentation page for the RGB clock kit. == Overview == Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs. The PCB is designed for …'
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== External resources ==
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
e1b568ab51a69399681b2d86972606c71247a183
166
165
2012-01-09T16:22:21Z
Tom
4
/* Future hardware enhancements */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== External resources ==
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
== Changelog ==
1.0
* Initial public release
02f36c378f2b5578317fff3aa657688d2c3960b2
167
166
2012-01-09T16:22:48Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
== External resources ==
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
== Changelog ==
1.0
* Initial public release
861e077a5c384036f61dd76e88b023222684ed05
168
167
2012-01-09T17:09:37Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
== External resources ==
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
== Changelog ==
1.0
* Initial public release
41c37130f2b3307ef69025ba4add440fbf7bb9c5
169
168
2012-01-09T17:10:17Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
== Changelog ==
1.0
* Initial public release
839cf801c023c23426d12b82f8e10fc194b3d099
170
169
2012-01-09T17:11:58Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
== Changelog ==
1.0
* Initial public release
8cc130db75353f9ae5641ea759c15b899502e08c
171
170
2012-01-09T17:18:08Z
Tom
4
/* Assembling the kit */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
== Changelog ==
1.0
* Initial public release
26026857666ff0ad7168f717ebe0e64bf3c135af
173
171
2012-01-09T17:29:57Z
Tom
4
/* The software */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards.
== Changelog ==
1.0
* Initial public release
9d2c993afa323e6a5bdbf756d1eac2fc686e85ea
174
173
2012-01-09T17:30:44Z
Tom
4
/* The software */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Changelog ==
1.0
* Initial public release
d5b87896342be9d413e6a4eecb76060414d9dbed
175
174
2012-01-09T17:31:06Z
Tom
4
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
bd5caaa4fe4b50e07ad59b5a7e606057a6324e62
176
175
2012-01-09T17:43:41Z
Tom
4
/* Assembling the kit */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
120dbf27d110428d36eae779ac061abad98986eb
177
176
2012-01-09T17:45:50Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
30e3180ba958769e9a1218da41ff1a63a8d17ba9
178
177
2012-01-09T17:51:17Z
Tom
4
/* Assembling the kit */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.
== Assembling the kit ==
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
caed9cb4b5520502c2f5ef89bb8e36786c230478
179
178
2012-01-09T18:15:56Z
Tom
4
/* Overview */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
c6a76d8ecdf4387593cf9fc93f6d7a6935e8ae86
180
179
2012-01-09T18:30:56Z
Tom
4
/* Assembling the kit */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parrallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
155dc490f2ccb5e22138238ce4bd4050144ee8f8
183
180
2012-01-11T12:48:20Z
Tom
4
/* Overview */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parrallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.
Open: LED driver board and microcontroller board have individual powersupplies
Closed: VCC from LED driver board and microcontroller board are connected.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
81af49de036b9cf8955e53fe4dd48ff1cd7a84b3
184
183
2012-01-11T14:00:25Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a bitwizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parrallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
95111ec59a8841a6e488f52ae4482e438454c173
186
184
2012-01-13T10:09:09Z
Rew
3
/* Overview */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parrallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
77810151523df016c30541d7089f00d7b5facee8
187
186
2012-01-13T10:11:04Z
Rew
3
/* Overview */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parrallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
ad1e6b72cdd4a1ed00f94c5ba2a47cc9dfb0cc3a
188
187
2012-01-13T10:15:00Z
Rew
3
/* LED chains */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>GND</td></tr>
<tr><td> 3</td><td>SER0</td></tr>
<tr><td> 4</td><td>SER1</td></tr>
<tr><td> 5</td><td>SER2</td></tr>
<tr><td> 6</td><td>SER3</td></tr>
<tr><td> 7</td><td>!OE</td></tr>
<tr><td> 8</td><td>LATCH</td></tr>
<tr><td> 9</td><td>!RESET</td></tr>
<tr><td>10</td><td>CLOCK</td></tr>
<tr><td>11</td><td>R</td></tr>
<tr><td>12</td><td>G</td></tr>
<tr><td>13</td><td>B</td></tr>
<tr><td>14</td><td>external clock source</td></tr>
<tr><td>15</td><td>IO1</td></tr>
<tr><td>16</td><td>IO0</td></tr>
<tr><td>17</td><td>IO3</td></tr>
<tr><td>18</td><td>IO2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 form SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
d9cf7b1b2f958c709a3a9b8d33a698d4d685a795
189
188
2012-01-13T10:25:03Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
927eb04dc2e08525189b884a388bdac42e02ec7c
190
189
2012-01-13T10:40:01Z
Rew
3
/* Future hardware enhancements */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
7481f4f1b0974e90dd7a5d59e1331314cda56ca0
210
190
2012-01-16T15:50:51Z
Tom
4
/* The software */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
b131dbddc05f3c212dc3f5a40e1ef67e4590d344
211
210
2012-01-16T16:00:53Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
5e6e9ad405f8037a179c07f1db07766e4a0fc999
215
211
2012-01-16T16:26:43Z
Tom
4
/* LED Driver PCB */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
All R, G and B pins should be connected in parallel.<br>
<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
b930b364642eb5f7b6d2c7401d8c61d2bb374302
Main Page
0
1
172
84
2012-01-09T17:24:20Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* [[8 FETs]]
* [[FTDI_ATmega]]
* [[usbio]] (or multiio).
* [[usbbigmultio]]
* [[RGB clock]]
* [[USB-SATA powerswitch]]
* [[FTDI serial]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Servotester]]
* [[AVR Bigmega]]
* [[USB-opto]]
* [[Digital potentiometer]]
* [[Cyclone dev board]]
* [[16 LEDs]]
* [[Two-wire LCD interface]]
* [[Two-wire servo interface]]
* [[Two-wire LM35/thermocouple interface]]
3aa114e76ad825ddbd3cf808706948dcc2611bfe
File:Afb000.jpg
6
28
192
2012-01-15T18:46:22Z
David
17
AVR Development Board programmed with Arduino software to control the temperature on an aircraft repair
wikitext
text/x-wiki
AVR Development Board programmed with Arduino software to control the temperature on an aircraft repair
34930a14a2bdf0b1c7247159dc6ff1debd80e7f8
194
192
2012-01-15T20:34:55Z
David
17
uploaded a new version of "[[File:Afb000.jpg]]"
wikitext
text/x-wiki
AVR Development Board programmed with Arduino software to control the temperature on an aircraft repair
34930a14a2bdf0b1c7247159dc6ff1debd80e7f8
202
194
2012-01-16T14:12:14Z
Tom
4
uploaded a new version of "[[File:Afb000.jpg]]": Reupload, due to server side problems
wikitext
text/x-wiki
AVR Development Board programmed with Arduino software to control the temperature on an aircraft repair
34930a14a2bdf0b1c7247159dc6ff1debd80e7f8
File:USBio bottom.jpg
6
31
206
2012-01-16T15:41:51Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:USBio top.jpg
6
32
208
2012-01-16T15:43:08Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:USBio clock.jpg
6
33
212
2012-01-16T16:15:22Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:RGB clock top.jpg
6
34
214
2012-01-16T16:26:35Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:RGB LED closeup.jpg
6
35
216
2012-01-16T16:31:37Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:RGB clock quadrant.jpg
6
36
217
2012-01-16T16:33:42Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
RGB clock
0
25
218
215
2012-01-16T16:36:02Z
Tom
4
/* LED chains */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
605abf01d614b8402064df2cfc51f1bf697bc9fc
220
218
2012-01-16T16:37:28Z
Tom
4
/* Putting it all together */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
1b4cc604358beae099d6fc3f3d457ffe41a728de
221
220
2012-01-16T16:50:45Z
Tom
4
/* The software */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
4179cace69e1691938daecb16a36e3712c7e5b50
223
221
2012-01-16T16:58:28Z
Tom
4
/* Putting it all together */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
ffae2c366f56f73d353f4236759172d96767a172
224
223
2012-01-16T17:04:27Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
Leds:
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
d79bceae6e64f3e94fc164e13a2df33bb26e44fa
225
224
2012-01-16T17:06:02Z
Rew
3
/* alternative use */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
Leds:
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping.
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
33cbdaec0156906c5d7f0cc3ec202bc085ffbb00
226
225
2012-01-16T17:31:35Z
Rew
3
/* alternative use */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
Leds:
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( )
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
78d532d2ea431aa5293dd1a73fc84f19d6f89dbc
227
226
2012-01-16T17:33:28Z
Rew
3
/* alternative use */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V. We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
Leds:
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
<br>
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
32d6b68aaf0745b8f454fc1963a417e33933f90e
230
227
2012-01-17T09:19:16Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== building your own clock-face ==
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
f74f6387c65b1eb05a3735b185ca3bbec8c8f89b
231
230
2012-01-17T09:19:31Z
Tom
4
/* building your own clock-face */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
5884c2772da0b2ff3f634051a6c375c1dfbd7d9b
232
231
2012-01-17T09:20:23Z
Tom
4
/* Assembling the kit */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
86aeb6410dcce68db2a653c16dce8427354f6207
235
232
2012-01-17T10:10:35Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembling the kit ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
76e92a204cdb0eb22a08d4cb736699bbc76e181e
236
235
2012-01-17T10:11:05Z
Tom
4
/* Assembling the kit */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Changelog ==
1.0
* Initial public release
ffaae32ae8b21836de494d4b24f2fce62983f9fc
241
236
2012-01-17T10:13:01Z
Tom
4
/* Future hardware enhancements */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
1.0
* Initial public release
24de710e9da602f33e3d659e284882ee32f04b82
242
241
2012-01-17T10:14:27Z
Tom
4
/* The software */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the clock.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
1.0
* Initial public release
de752d061ea1c410d30ce3b447fbae6cc60117b1
243
242
2012-01-17T10:14:52Z
Tom
4
/* programming */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches.<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
1.0
* Initial public release
4c5161391076ed0cb356771f314884254b728965
244
243
2012-01-17T10:16:32Z
Tom
4
/* Putting it all together */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
1.0
* Initial public release
e87f25b6b1cb154645a78d82344aa514c33d1b7e
246
244
2012-01-17T10:21:18Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a459452a8e5bde37894b5ce1e6c70ebd1cec1e2c
248
246
2012-01-17T12:14:24Z
Rew
3
/* Adjusting the white-balance */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800. Hmm. Apparently the defaults do not listen to me. :-(
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
8caf9c279a856661e83b7afcde41ff1e8acf8c86
255
248
2012-01-17T14:23:42Z
Tom
4
/* Leds: */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800. Hmm. Apparently the defaults do not listen to me. :-(
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
26769ad07d4bbadac450055b16bea52f766e2ab9
258
255
2012-01-17T16:22:26Z
Tom
4
/* Adjusting the white-balance */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
4a765929760065de31970aac767530ffe01e6133
259
258
2012-01-17T16:22:38Z
Tom
4
/* Adjusting the white-balance */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
b733f4796167018b4aab1d46f9a1ce706b0be459
263
259
2012-01-17T16:26:52Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
329cf87c32610847f678b0b5fb3a6f5565b9ac95
267
263
2012-01-18T17:07:28Z
Tom
4
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg|thumb|300px|alt=Everything wired-up|Everything wired-up]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0ab15c39686a731d10617708a5b31d63c9649529
268
267
2012-01-18T17:10:39Z
Tom
4
Reverted edits by [[Special:Contributions/Tom|Tom]] ([[User talk:Tom|Talk]]) to last revision by [[User:Rew|Rew]]
wikitext
text/x-wiki
= RGB clock =
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== Leds: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800. Hmm. Apparently the defaults do not listen to me. :-(
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
8caf9c279a856661e83b7afcde41ff1e8acf8c86
269
268
2012-01-18T17:11:26Z
Tom
4
Undo revision 268 by [[Special:Contributions/Tom|Tom]] ([[User talk:Tom|Talk]])
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg|thumb|300px|alt=Everything wired-up|Everything wired-up]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0ab15c39686a731d10617708a5b31d63c9649529
270
269
2012-01-18T17:12:00Z
Tom
4
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
daca0eedd42833d1fbc73303a822fe50dab4075f
271
270
2012-01-18T17:12:43Z
Tom
4
/* Putting it all together */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the leds are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg]]<br>
<br>
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg]]<br>
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".<br>
[[File:RGB_clock_connectors.jpg]]<br>
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:<br>
[[File:RGB_clock_complete.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If the complete device is powered from the microcontroller board, the jumper can be replaced with a toggle switch. This allows you to turn the LEDs on and off, without affecting timekeeping. (Untested: Possibly the charging of the capacitor on the PCB will cause a brownout on the MCU board. :-( . Solutions are: decrease the value of the capacitor on the RGB clock board, increase the value of the capacitor on the multiio board, or patch the capacitor on the RGB board to be connected to the "from the controller board" signal instead of to the "local power" signal.)
* If you want to measure the powerconsumption of the leds, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
3e7402299e3c8b2b7f15c91dd7fcc68044783a7a
272
271
2012-01-18T17:28:08Z
Tom
4
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards. A link to the sources will be posted within a few days (It's Jan 9th 2012 at the moment).
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
fefba0922940ae7ce632ecabe3bffff026ad672d
File:RGB clock complete.jpg
6
37
219
2012-01-16T16:37:20Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
266
219
2012-01-18T16:51:45Z
Tom
4
uploaded a new version of "[[File:RGB clock complete.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:RGB clock connectors.jpg
6
38
222
2012-01-16T16:56:45Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
FTDI ATmega
0
6
228
185
2012-01-16T18:00:20Z
Rew
3
/* FTDI-atmega */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
8d49835009b845314ba2d2eb755120a97717e7fe
229
228
2012-01-16T18:49:24Z
David
17
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
95132fa85da9ec3105815bc4315ba0d15a7ba068
233
229
2012-01-17T10:10:29Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
3a6e914da6a58c06a7bb35620519561fbabe78c2
238
233
2012-01-17T10:11:27Z
Tom
4
/* overview */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
== Arduino Pinout ==
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
db4a35776388a25c733b50ad59ea27aa7458509d
239
238
2012-01-17T10:12:01Z
Tom
4
/* Arduino Pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
bfcc1c9c6252eeb4409f0384b7abc56a26c6220a
240
239
2012-01-17T10:12:22Z
Tom
4
/* programming */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
7.0
* Initial public release
7.1
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
553707909580b70296b8af2ddb14baac5a017a42
245
240
2012-01-17T10:21:07Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
acd4e39ffba5bf1d5319007b68f0a7049d400fed
249
245
2012-01-17T14:12:44Z
Tom
4
/* future software enhancements */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
51c5e4794784222a3c84ea109e97b5713716512c
251
249
2012-01-17T14:14:21Z
Tom
4
/* Assembly instructions */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
Nothing to be done, the module comes completely assembled, as in the picture below:<br>
[[File:ftdi_atmega_top.jpg]]
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
fc0e72e333609bfaeb1297b4d2987157ee26ca37
252
251
2012-01-17T14:19:42Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
Nothing to be done, the module comes completely assembled, as in the picture below:<br>
[[File:ftdi_atmega_top.jpg]]
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC5
* led5 is connected to PC4 (absent on V7.0)
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
65c9d6316981dbc95033b812c96a8bd0c6bde96d
253
252
2012-01-17T14:22:04Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
Nothing to be done, the module comes completely assembled, as in the picture below:<br>
[[File:ftdi_atmega_top.jpg]]
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
70b111cfcce762122744ba831f724f251ba310fc
254
253
2012-01-17T14:23:32Z
Tom
4
/* pinout */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
Nothing to be done, the module comes completely assembled, as in the picture below:<br>
[[File:ftdi_atmega_top.jpg]]
== External resources ==
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
fc79e2e3b7a442895db0de31245b4d0c496848eb
262
254
2012-01-17T16:26:10Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= FTDI-atmega =
This is the documentation page for the FTDI-atmega PCB. which can be purchased here: http://www.bitwizard.nl/catalog/product_info.php?products_id=29
== overview ==
The FTDI-atmega PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.
== Assembly instructions ==
Nothing to be done, the module comes completely assembled, as in the picture below:<br>
[[File:ftdi_atmega_top.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|AVR Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
a47ed1e21fb94a01aaac496ffd4e8fad129a1dc4
264
262
2012-01-17T23:57:53Z
David
17
changed the introduction for readability.
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC3</td></tr>
<tr><td>4</td><td>PC2</td></tr>
<tr><td>5</td><td>PC1</td></tr>
<tr><td>6</td><td>PC0</td></tr>
<tr><td>7</td><td>PB5</td></tr>
<tr><td>8</td><td>PB4</td></tr>
<tr><td>9</td><td>PB3</td></tr>
<tr><td>10</td><td>PB2</td></tr>
<tr><td>11</td><td>PB1</td></tr>
<tr><td>12</td><td>PB0</td></tr>
<tr><td>13</td><td>PD7</td></tr>
<tr><td>14</td><td>PD6</td></tr>
<tr><td>15</td><td>PD5</td></tr>
<tr><td>16</td><td>PD4</td></tr>
<tr><td>17</td><td>PD3</td></tr>
<tr><td>18</td><td>PD2</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
65dfaaf0cd7a2c2d81a15d15403b9290dab044aa
265
264
2012-01-18T00:03:01Z
David
17
/* pinout */ changed pinout for readability
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, the onboard LED is connected to pin A5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
785643e47f5aed119989f08e8b40f8d7a66a71f8
File:Ftdi atmega top.jpg
6
39
250
2012-01-17T14:13:59Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Usbbigmultio
0
5
260
151
2012-01-17T16:23:24Z
Tom
4
/* overview */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
9fbe5799dcaa8f45e03ad7b279a5d9f3837ee1e0
261
260
2012-01-17T16:25:32Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/7766S.pdf ATmega16/32U4 datasheet]
=== Related projects ===
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
6bdb86c09ef71c4c8c79caa8074a995b5e3d276c
Main Page
0
1
274
172
2012-01-19T14:21:04Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Developement boards
** [[FTDI_ATmega]]
** [[usbio]] (or multiio).
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[Digital potentiometer]]
** [[16 LEDs]]
** [[8 FETs]]
** [[Two-wire LCD interface]]
** [[Two-wire servo interface]]
** [[Two-wire LM35/thermocouple interface]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
8f28fdf96976ce67d8dbc1745562d7151c4196da
278
274
2012-01-21T00:58:23Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[usbio]] (or multiio).
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[Digital potentiometer]]
** [[16 LEDs]]
** [[8 FETs]]
** [[Two-wire LCD interface]]
** [[Two-wire servo interface]]
** [[Two-wire LM35/thermocouple interface]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
8ef3bc1fb7b760892c3bc6aea2c3e3bf2e55e404
292
278
2012-01-23T20:10:46Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[Digital potentiometer]]
** [[16 LEDs]]
** [[8 FETs]]
** [[Two-wire LCD interface]]
** [[Two-wire servo interface]]
** [[Two-wire LM35/thermocouple interface]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
eb942cb34efc28ef3572c6894e0a4bdf3c272044
296
292
2012-01-25T14:44:07Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
39c7b2f199694e67dfef942c474080d454328f43
297
296
2012-01-25T14:45:20Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
[[template]]
f9a9a0a5a888a3618364d21d5b8ca8f16c6192b4
306
297
2012-01-25T16:16:44Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
** [[Raspberry Pi Serial]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
[[template]]
20d7de4d17b3b2d4c95561d8ed747e7d62074258
FTDI ATmega
0
6
275
265
2012-01-19T18:49:17Z
David
17
/* Arduino Pinout */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
e5bd8efff716e860a6259cfb8d8e353e9de60c80
318
275
2012-01-26T16:13:25Z
Rew
3
/* programming */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
8f7711734d47dd7b8d9915fbbfbb1e05c6e02f0e
319
318
2012-01-26T16:15:03Z
Rew
3
/* Use as a programmer */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
d570b4e2fc1383b97551489b7884765fcb71ac4f
321
319
2012-01-26T16:22:57Z
Rew
3
/* Use as a programmer */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>A3</td><td>A2</td></tr>
<tr><td>A1</td><td>A0</td></tr>
<tr><td>13</td><td>12</td></tr>
<tr><td>11</td><td>10</td></tr>
<tr><td>9</td><td>8</td></tr>
<tr><td>7</td><td>6</td></tr>
<tr><td>5</td><td>4</td></tr>
<tr><td>3</td><td>2</td></tr>
<tr><td>V+</td><td>V+</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
07b45bcb43816d99b77d50acca205997254d30e4
322
321
2012-01-26T16:24:33Z
Rew
3
/* Arduino Pinout */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== windows ===
See the linux section above.
== writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== b7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
34935a3521faf989dccc451c676b43d4a22c759c
RGB clock
0
25
277
272
2012-01-20T19:21:56Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the source code can be downloaded here: [[File:RGB_clock-20120120.zip]]
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
9ee8632a44b3fa72c8c70ef4530aef4f8da9e9e5
284
277
2012-01-23T11:43:43Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the source code can be downloaded here: [[File:RGB_clock.zip]]
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5f8b8b6e647eee01054f2344952d8c36432b224f
287
284
2012-01-23T11:49:06Z
Tom
4
/* Putting it all together */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the source code can be downloaded here: [[File:RGB_clock.zip]]
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c5b8e3b5362f00b3389dd1bb46ee1610003022b2
289
287
2012-01-23T15:55:34Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
7df8461135c225ddcb4f2178242fb08c26efe1cd
294
289
2012-01-23T20:13:03Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
29b5de96aedbb7562af8685c2b077e7bfa5c3732
Linux
0
41
279
2012-01-21T01:06:54Z
Tom
4
Created page with '== Installing the required packages == === Ubuntu === Installing the compiler, and the libraries: sudo apt-get install gcc-avr avr-libc Installing programming software (depen…'
wikitext
text/x-wiki
== Installing the required packages ==
=== Ubuntu ===
Installing the compiler, and the libraries:
sudo apt-get install gcc-avr avr-libc
Installing programming software (depending on your programmer):
For AVRs with embedded USB (such as the AT90USB162, ATmega8/16/32U2, ATmega16/32U4:
sudo apt-get install dfu-programmer
When using an external ISP programmer, or our FTDI-atmega board, or arduino's:
sudo apt-get install avrdude avrdude-doc
We advice putting all your projects in a common directory, for example ~/avr/ .
371e72069aca2d9a4bf927e14e76711880eadb61
280
279
2012-01-21T11:56:01Z
Tom
4
/* Ubuntu */
wikitext
text/x-wiki
== Installing the required packages ==
=== Ubuntu ===
Installing the compiler, and the libraries:
sudo apt-get install gcc-avr avr-libc
Installing programming software (depending on your programmer):
For AVRs with embedded USB (such as the AT90USB82/162, ATmega8/16/32U2, ATmega16/32U4:
sudo apt-get install dfu-programmer
When using an external ISP programmer, or our FTDI-atmega board, or arduino's:
sudo apt-get install avrdude avrdude-doc
We advice putting all your projects in a common directory, for example ~/avr/ .
b3d1731577c0d897c891b8790ad52a58f1df4963
Usbbigmultio
0
5
282
261
2012-01-21T12:47:38Z
Tom
4
/* External resources */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/7766S.pdf ATmega16/32U4 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
== pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
87f02f21e7acef27674783b426369270b1d2e7fd
File:RGB clock back complete.jpg
6
44
286
2012-01-23T11:48:46Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Usbio
0
45
291
2012-01-23T20:10:02Z
Tom
4
moved [[Usbio]] to [[USB-multio]]
wikitext
text/x-wiki
#REDIRECT [[USB-multio]]
0775cf9ff5abe6475396a0955817a5ed7c21cc9b
USB-multio
0
46
295
2012-01-23T23:07:39Z
Tom
4
Created page with '[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]] This is the documentation page for the USB-Multio PCB. == overview == The USB-Multio PCB has an USB conne…'
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the ISP or RESET header, makes it impossible to plug the USBio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct.
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
0d889f9885cc643cb5a606e7651f3256cd9f43f9
320
295
2012-01-26T16:21:57Z
Rew
3
/* programming */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the ISP or RESET header, makes it impossible to plug the USBio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct.
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
79881f4a7c28cc49737c29163764cd6b8337f2e8
328
320
2012-01-30T15:39:37Z
Tom
4
/* writing programs */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the ISP or RESET header, makes it impossible to plug the USBio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct.
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
== future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
cde13e43a79acc11c5358cbd7a9e53e80ac5841f
330
328
2012-01-30T15:42:05Z
Tom
4
/* Physical dimensions */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the ISP or RESET header, makes it impossible to plug the USBio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct.
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
6050630a6ef6e1e7ac5deba8fe94cf077ac14367
331
330
2012-01-30T15:42:18Z
Tom
4
/* LEDs */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the ISP or RESET header, makes it impossible to plug the USBio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct.
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
5ee840f19659990c356197d479109cdccbc87edd
334
331
2012-01-31T13:47:28Z
Rew
3
/* Directly plugged into breadboard */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct.
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
dfc73b3fbb7b79a24521bad2513662340d65f771
335
334
2012-01-31T13:48:55Z
Rew
3
/* Connected with 20p ribbon cable */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
9f7b7b3147c1928295fdd39a26d0b4175681af54
Template
0
47
298
2012-01-25T14:48:57Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for . == Overview == == Assembly instructions == === Possible Configurations === == External resources == …'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for .
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
d095d32f2023ccb5dbf6181d6f048e7a3de9f30d
SPI LCD
0
48
299
2012-01-25T15:03:38Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for the SPI_LCD board. == Overview == == Assembly instructions == === Possible Configurations === == Exter…'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
257785afabe29e587abb6b26a2461b71c865e4a0
308
299
2012-01-25T16:28:22Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
ab3edddcbf6cdf01c5e1fc8538d09c8391dc58c3
329
308
2012-01-30T15:41:39Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD.
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xff <byte> will send the byte to the LCD without special character processing. Tthis allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
9bee16b130ec051e862c4760d8d6aadc9076f9bb
332
329
2012-01-30T15:50:48Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD.
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
c8e8d1be1ffe6419fbe5b53888decc933f5264e7
337
332
2012-01-31T17:20:20Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD.
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
3bff4032ff3f6802e4f7a48c9e2e69073b586b41
7FETs
0
49
300
2012-01-25T15:03:39Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for the SPI_6FETs board. == Overview == == Assembly instructions == === Possible Configurations === == Ext…'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_6FETs board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0cdd5afee1afb36466bca1b2ba52e5dd7ee47d6c
310
300
2012-01-25T16:29:51Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_6FETs PCB|The SPI_6FETs PCB]]
This is the documentation page for the SPI_6FETs board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f3c74a4a27cf700ef68a6437b660bdceba3be519
Servo
0
50
301
2012-01-25T15:03:40Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for the SPI_servo board. == Overview == == Assembly instructions == === Possible Configurations === == Ext…'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_servo board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
* Add extra power connector for servo power
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
15dbbbc5f077cdca75594b84aa66e36d48751e26
312
301
2012-01-25T16:31:50Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
* Add extra power connector for servo power
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c6f7c86a60c8d2f3053ba4ff3af19b509121ebd2
Temperature Interface
0
51
302
2012-01-25T15:03:41Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for the SPI_LM35 board. == Overview == == Assembly instructions == === Possible Configurations === == Exte…'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a74012c89ebea2beb83446ff0ac3a930cd07af6e
DIO
0
52
303
2012-01-25T15:03:42Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for the SPI_DIO board. == Overview == == Assembly instructions == === Possible Configurations === == Exter…'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_DIO board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
41f6a7544ce4e3168be961f326dacc399514b2d0
Relay
0
53
304
2012-01-25T15:03:44Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for the SPI_relay board. == Overview == == Assembly instructions == === Possible Configurations === == Ext…'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_relay board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
bcd6bc100312cf2a562090bba131ec145b8ea12a
16 LEDs
0
54
305
2012-01-25T15:03:45Z
Tom
4
Created page with '[[File:.jpg|thumb|300px|alt=|]] This is the documentation page for the 16-LEDs board. == Overview == == Assembly instructions == === Possible Configurations === == Exter…'
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the 16-LEDs board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
0ed2b9a8933e20f358195a52c078fa65882cfda9
316
305
2012-01-25T17:43:28Z
Tom
4
wikitext
text/x-wiki
[[File:16_LEDs.jpg|thumb|300px|alt=The 16-LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
d829059085f160900a6a02713224a7913be2fd5b
317
316
2012-01-25T17:43:43Z
Tom
4
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
d15ebf6dd2da166f8997cfd62f9315c3e34176cc
File:SPI LCD.jpg
6
55
307
2012-01-25T16:27:56Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:SPI 6FETs.jpg
6
56
309
2012-01-25T16:29:27Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:SPI Servo.jpg
6
57
311
2012-01-25T16:31:25Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Rpi serial.jpg
6
58
313
2012-01-25T16:32:48Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Raspberry Pi Serial
0
59
314
2012-01-25T16:33:19Z
Tom
4
Created page with '[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]] This is the documentation page for the Raspberry Pi Serial board. == Overvi…'
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
5cabe4c787a6e5ad8e9b54df6794a3ca16a72a10
File:16-LEDs.jpg
6
60
315
2012-01-25T17:42:39Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
SPI LCD
0
48
338
337
2012-01-31T17:31:10Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD.
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
fb3320d60edd973078451da70cdd6e659fbb3171
340
338
2012-02-01T11:03:49Z
Tom
4
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
65e84c27aa8462ec44bda2765d63a6a557091339
365
340
2012-02-06T12:05:41Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
76673de764c6fcd5dbb0a57ad5953eb30ea7af64
375
365
2012-02-07T15:08:07Z
Rew
3
/* Assembly instructions */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
01120a1293968ac4390f30424a09f9c14dabe8ce
376
375
2012-02-07T15:15:54Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
e35b1c67812f8b1521287bf8e4366f5c4f3a64de
377
376
2012-02-07T15:22:39Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
3cebc3fcd87b6a2f2f892f87f9c8ef0207e71c6d
378
377
2012-02-07T15:34:09Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
e2cf6f51809b6e17bbac9a763499eabb1608dd31
379
378
2012-02-07T15:50:55Z
Rew
3
/* The software */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
43a74b7fc8be9abae96d699df372eed87ef02aef
380
379
2012-02-07T16:00:08Z
Rew
3
/* The software */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
5eb288136ba2810e7aa3f3c1ad9fc873acd49798
381
380
2012-02-07T16:03:03Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
a686066e737220b3772122adda1154d11e8ad830
382
381
2012-02-07T16:04:08Z
Rew
3
/* Future software enhancements */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Future hardware enhancements ==
== Future software enhancements ==
* Allow customization of the opening text.
== Changelog ==
=== 1.2 ===
* Initial public release
f301b67317bcab117736f3e2c790d4dcdc32db50
383
382
2012-02-07T16:04:16Z
Rew
3
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
== Changelog ==
=== 1.2 ===
* Initial public release
aafbbb01e000fad304ead416624b8938a21cf90a
386
383
2012-02-07T16:14:46Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
== Changelog ==
=== 1.2 ===
* Initial public release
c737bccb46eac040ae5c4b21c7f7ca8f58e7e4df
387
386
2012-02-07T16:19:36Z
Rew
3
/* Future software enhancements */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
* Allow different sizes of LCDs.
== Changelog ==
=== 1.2 ===
* Initial public release
85cc1942b7661ae5a3bf4def7bd2cb73540c81cc
388
387
2012-02-07T16:20:57Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Physical size ==
The board is 50x20mm. The mounting holes are 3mm from the edges. So the distances between the holes are 17x47 mm.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
* Allow different sizes of LCDs.
== Changelog ==
=== 1.2 ===
* Initial public release
610335fc54f7f98c6dce132c1f8bf359e677e574
389
388
2012-02-07T16:21:13Z
Rew
3
/* Physical size */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Physical size ==
The board is 50x20mm. The mounting holes are 3mm from the edges. So the distances between the holes are 47x17 mm.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
* Allow different sizes of LCDs.
== Changelog ==
=== 1.2 ===
* Initial public release
6899349fc52f5e10649b45f5156f07c24c725022
390
389
2012-02-07T16:21:29Z
Rew
3
/* Physical size */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
The board could be configured with software for I2C.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Physical size ==
The board is 50x20mm. The mounting holes are 3mm from the edges. So the distances between the holes are 47x17mm.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
* Allow different sizes of LCDs.
== Changelog ==
=== 1.2 ===
* Initial public release
8fc12d44f007d24b294824c5cac36aa80622145b
391
390
2012-02-07T16:22:22Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
* The board could be configured with software for I2C.
* The seconde SPI connector can be jumpered to be the ICSP connector for the AVR CPU on the board.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Physical size ==
The board is 50x20mm. The mounting holes are 3mm from the edges. So the distances between the holes are 47x17mm.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
* Allow different sizes of LCDs.
== Changelog ==
=== 1.2 ===
* Initial public release
653333f4d6591f0e05d9d1e88c55c41aa9be96a7
392
391
2012-02-07T16:22:42Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
* The board could be configured with software for I2C.
* The seconde SPI connector can be jumpered to be the ICSP connector for the AVR CPU on the board.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Physical size ==
The board is 50x20mm. The mounting holes are 3mm from the edges. So the distances between the holes are 47x17mm.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
* Allow different sizes of LCDs.
== Changelog ==
=== 1.2 ===
* Initial public release
764c37af82654a34df2ec8ba327a89ad3886874b
393
392
2012-02-07T16:23:23Z
Rew
3
/* Future software enhancements */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes assembled. No assembly required.
=== Possible Configurations ===
* The board could be configured with software for I2C.
* The seconde SPI connector can be jumpered to be the ICSP connector for the AVR CPU on the board.
== External resources ==
=== Datasheets ===
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
SPI connector:
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
== Additional software ==
=== Related projects ===
== Pinout ==
=== SPI ===
[[SPI connector pinout]]
=== LCD ===
{| border=1
! pin !! name
|-
| 1 || VSS
|-
| 2 || VDD
|-
| 3 || VO (contrast)
|-
| 4 || RS
|-
| 5 || RW (GND)
|-
| 6 || EN
|-
| 7 || DB0 (NC)
|-
| 8 || DB1 (NC)
|-
| 9 || DB2 (NC)
|-
| 10 || DB3 (NC)
|-
| 11 || DB4
|-
| 12 || DB5
|-
| 13 || DB6
|-
| 14 || DB7
|-
| 15 || BL + (VCC)
|-
| 16 || BL - (PWM)
|-
|}
=== LEDs ===
None. The board doesn't have leds. The next hardware revision might have a powerled.
== Power ==
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
See [[solder jumpers]] for more information on how to change the setting.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
When you send a "read" request there are two different commands:
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
== The software ==
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
A sample project which operates as a master is located here:
http://www.bitwizard.nl/spi_atmega/
== Default operation ==
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
The opening screen clears automatically when you first send any data.
Future versions of the software may allow changing the opening text through the SPI interface.
== Physical size ==
The board is 50x20mm. The mounting holes are 3mm from the edges. So the distances between the holes are 47x17mm.
== Future hardware enhancements ==
* power led.
== Future software enhancements ==
* Allow customization of the opening text.
* Allow different sizes of LCDs.
* Allow use of the spare eeprom bytes.
== Changelog ==
=== 1.2 ===
* Initial public release
11a715c17d4f45851bf8832e2b3b54af40b649a1
405
393
2012-02-08T19:52:33Z
Tom
4
Reverted edits by [[Special:Contributions/Rew|Rew]] ([[User talk:Rew|Talk]]) to last revision by [[User:Tom|Tom]]
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
65e84c27aa8462ec44bda2765d63a6a557091339
Main Page
0
1
341
306
2012-02-01T12:05:04Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
** [[Raspberry Pi Serial]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
* miscellaneous
** [[Solder jumpers]]
[[template]]
b7a78111f98b340ed73d26bc1323bfe6978facf3
346
341
2012-02-01T12:20:29Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
** [[Raspberry Pi Serial]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
* Miscellaneous
** [[Solder jumpers]]
[[template]]
b12ef0da938e685c7bb2c7613bb1fff46aa42aa5
368
346
2012-02-07T10:37:05Z
Rew
3
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
** [[Raspberry Pi Serial]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
* Miscellaneous
** [[Solder jumpers]]
[[raspberry pi expansion page]]
[[template]]
61dc6f8f9079996f57291fa7b5e55c9ffd9770a1
369
368
2012-02-07T10:37:19Z
Rew
3
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
** [[Raspberry Pi Serial]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
* Miscellaneous
** [[Solder jumpers]]
[[raspberry pi expansion system page]]
[[template]]
6985567e93efbef2c5bff27083051fd29576fce1
406
369
2012-02-08T19:54:09Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
** [[Raspberry Pi Serial]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
* Miscellaneous
** [[Solder jumpers]]
** [[raspberry pi expansion system page]]
** [[template]]
577b85225f518a8965c873463760f2499991caf5
File:Solder jumper cut.JPG
6
69
342
2012-02-01T12:06:24Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Solder jumper normal.JPG
6
70
343
2012-02-01T12:07:20Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Solder jumper soldered.JPG
6
71
344
2012-02-01T12:07:59Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Solder jumpers
0
72
345
2012-02-01T12:19:15Z
Tom
4
Created page with '== Solder jumpers == [[File:solder_jumper_normal.JPG|none|thumb|300px|alt=Trace still intact|Trace still intact]] Carefully(!!!) cut the naroow trace between the middle and righ…'
wikitext
text/x-wiki
== Solder jumpers ==
[[File:solder_jumper_normal.JPG|none|thumb|300px|alt=Trace still intact|Trace still intact]]
Carefully(!!!) cut the naroow trace between the middle and right pad with a sharp knife:
[[File:solder_jumper_cut.JPG|none|thumb|300px|alt=Trace is cut|Trace is cut]]
Place a solder jumper over the other two pads:
[[File:solder_jumper_soldered.JPG|none|thumb|300px|alt=New connection is created|New connection is created]]
33e46b3334e383d2eb3ddeb8883e9645e1dcb469
RGB clock
0
25
347
294
2012-02-01T12:21:11Z
Tom
4
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
daa7825068fe83675b4a00953099b54f3e3482f1
353
347
2012-02-03T10:18:32Z
Tom
4
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ac2dfe4fb5e40bd390b79ae978e3c44bc6073c92
402
353
2012-02-08T18:54:14Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c7da3d804f711117894683b9302160c7ab058c79
403
402
2012-02-08T18:55:10Z
Tom
4
/* Default operation */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
==== Loading custom bitmaps ====
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
35ba8d879af471c092b5471e55b829d31db74a44
404
403
2012-02-08T19:41:14Z
Tom
4
/* Loading custom bitmaps */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c999fc40e4e614930b6fbc9d764de2a3fe4c4a4b
407
404
2012-02-08T20:11:46Z
Tom
4
/* Test modes */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
The current firmware enables you to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
44d55ec3411c02c6b9bb7ea76733c0c9015bb743
408
407
2012-02-08T20:17:21Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward
Switch 3: Push to jump 1 minute forward
Switch 4: Push to reset the seconds to 0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
200c5a6ab94c7f176a72491610ef4475eceefad5
FTDI ATmega
0
6
348
322
2012-02-01T12:21:45Z
Tom
4
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
cda466071ad0858df85fba38202994af631275d0
USB-multio
0
46
349
335
2012-02-01T12:22:23Z
Tom
4
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
5d4b94810ba73b7051b3cfe690d016f261384060
Usbbigmultio
0
5
350
282
2012-02-01T12:22:56Z
Tom
4
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== Overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/7766S.pdf ATmega16/32U4 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
== Pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Future hardware enhancements ==
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
1.1
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
1.0
* Initial release
9decf3a491b62f484ef857a625417e040c329559
351
350
2012-02-01T12:23:16Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USBbigmultio PCB.
== Overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/7766S.pdf ATmega16/32U4 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
== Pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Future hardware enhancements ==
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 1.1 ===
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
=== 1.0 ===
* Initial release
ab07c7e518fb4e5683b2aa4260135cafbba81239
Cyclone dev board
0
9
352
143
2012-02-01T12:23:52Z
Tom
4
wikitext
text/x-wiki
= Cyclone dev board =
This is the documentation page for the Cyclone dev board.
== Overview ==
The Cyclone dev board has an USB connector and 4 20-pin IO connector. The brains of the PCB is an EP1C6T144C8 (or compatible) chip.
== External resources ==
== Pinout ==
The 20 pin connectors are connected as follows
SV1
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 3</td></tr>
<tr><td>4</td><td>pin 2</td></tr>
<tr><td>5</td><td>pin 5</td></tr>
<tr><td>6</td><td>pin 4</td></tr>
<tr><td>7</td><td>pin 6</td></tr>
<tr><td>8</td><td>pin 7</td></tr>
<tr><td>9</td><td>pin 26</td></tr>
<tr><td>10</td><td>pin 10</td></tr>
<tr><td>11</td><td>pin 32</td></tr>
<tr><td>12</td><td>pin 27</td></tr>
<tr><td>13</td><td>pin 34</td></tr>
<tr><td>14</td><td>pin 33</td></tr>
<tr><td>15</td><td>pin 36</td></tr>
<tr><td>16</td><td>pin 35</td></tr>
<tr><td>17</td><td>pin 38</td></tr>
<tr><td>18</td><td>pin 37</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV2
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 40</td></tr>
<tr><td>4</td><td>pin 39</td></tr>
<tr><td>5</td><td>pin 42</td></tr>
<tr><td>6</td><td>pin 41</td></tr>
<tr><td>7</td><td>pin 49</td></tr>
<tr><td>8</td><td>pin 47</td></tr>
<tr><td>9</td><td>pin 51</td></tr>
<tr><td>10</td><td>pin 50</td></tr>
<tr><td>11</td><td>pin 53</td></tr>
<tr><td>12</td><td>pin 52</td></tr>
<tr><td>13</td><td>pin 58</td></tr>
<tr><td>14</td><td>pin 57</td></tr>
<tr><td>15</td><td>pin 60</td></tr>
<tr><td>16</td><td>pin 59</td></tr>
<tr><td>17</td><td>pin 67</td></tr>
<tr><td>18</td><td>pin 62</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV3
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 69</td></tr>
<tr><td>4</td><td>pin 68</td></tr>
<tr><td>5</td><td>pin 73</td></tr>
<tr><td>6</td><td>pin 72</td></tr>
<tr><td>7</td><td>pin 75</td></tr>
<tr><td>8</td><td>pin 74</td></tr>
<tr><td>9</td><td>pin 77</td></tr>
<tr><td>10</td><td>pin 76</td></tr>
<tr><td>11</td><td>pin 82</td></tr>
<tr><td>12</td><td>pin 78</td></tr>
<tr><td>13</td><td>pin 84</td></tr>
<tr><td>14</td><td>pin 83</td></tr>
<tr><td>15</td><td>pin 96</td></tr>
<tr><td>16</td><td>pin 85</td></tr>
<tr><td>17</td><td>pin 110</td></tr>
<tr><td>18</td><td>pin 109</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV4
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>pin 112</td></tr>
<tr><td>4</td><td>pin 111</td></tr>
<tr><td>5</td><td>pin 114</td></tr>
<tr><td>6</td><td>pin 113</td></tr>
<tr><td>7</td><td>pin 121</td></tr>
<tr><td>8</td><td>pin 119</td></tr>
<tr><td>9</td><td>pin 123</td></tr>
<tr><td>10</td><td>pin 122</td></tr>
<tr><td>11</td><td>pin 128</td></tr>
<tr><td>12</td><td>pin 124</td></tr>
<tr><td>13</td><td>pin 130</td></tr>
<tr><td>14</td><td>pin 129</td></tr>
<tr><td>15</td><td>pin 132</td></tr>
<tr><td>16</td><td>pin 131</td></tr>
<tr><td>17</td><td>pin 140</td></tr>
<tr><td>18</td><td>pin 139</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
SV5
<table border=1>
<tr><td>1</td><td>3V3</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>CLK3</td></tr>
<tr><td>4</td><td>CLK2</td></tr>
<tr><td>5</td><td>CLK1</td></tr>
<tr><td>6</td><td>CLK0</td></tr>
</table>
SV6
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>VCCINT</td></tr>
<tr><td>3</td><td>3V3</td></tr>
<tr><td>4</td><td>5V</td></tr>
</table>
JP2
<table border=1>
<tr><td>1</td><td>EXT_RESET</td></tr>
<tr><td>2</td><td>GND</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to pin 144
* led3 is connected to conf_done
* led4 is connected to pin 143
* led5 is connected to pin 142
* led6 is connected to pin 141
== Jumper settings ==
JP1: 5V power supply selection<br>
1-2 5V from USB<br>
3-4 5V from wall-wart powered regulator<br>
== Programming ==
This section describes how you get your program into the FPGA.
=== Linux ===
=== Windows ===
== Writing programs ==
The chip is an EP1C6T144C8. http://www.altera.com/literature/lit-cyc.jsp
== Future hardware enhancements ==
* Update Mini-B footprint
== Future software enhancements ==
== Changelog ==
=== 4.1 ===
* Initial public release
6022662275b27c932b20e3e63330b684b4b3998c
Raspberry pi expansion system page
0
86
370
2012-02-07T10:41:38Z
Rew
3
Created page with '= intro = If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look! = rpi_serial = The rpi_serial board is the simplest…'
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
f73cb3779ec8578577927a0501fc64a8455279cc
371
370
2012-02-07T10:42:45Z
Rew
3
/* expansion boards */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
22d2103612301da722d0993f948cb2d419cdf317
372
371
2012-02-07T10:43:34Z
Rew
3
/* rpi_serial */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
** [[SPI_LCD]]
** [[SPI_6FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
11e96f123f763d30237af9bb7b215bbb6afc53d5
373
372
2012-02-07T10:48:17Z
Rew
3
/* expansion boards */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
* [[SPI_LCD]]
* [[SPI_6FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
These expansion boards have two SPI connectors. The first SPI connector is for data transfer during normal operation. The other can be used to daisy-chain the SPI bus to other SPI expansion boards. Or it can be configured to be used as the programming port for the onboard AVR chip.
It should be possible to use one of the raspberry pi SPI buses for data-transfer, while you use the other one to program the AVR chip on the expansion board.
fa600ebd907ba098f34c8d1c466a3499c878093f
374
373
2012-02-07T10:48:57Z
Rew
3
/* expansion boards */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
The following expansion boards have been designed:
* [[SPI_LCD]]
* [[SPI_6FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
These expansion boards have two SPI connectors. The first SPI connector is for data transfer during normal operation. The other can be used to daisy-chain the SPI bus to other SPI expansion boards. Or it can be configured to be used as the programming port for the onboard AVR chip.
It should be possible to use one of the raspberry pi SPI buses for data-transfer, while you use the other one to program the AVR chip on the expansion board.
b67e77369442bd44673d3b16d3f6e2b84844bbc8
SPI connector pinout
0
87
384
2012-02-07T16:12:38Z
Rew
3
Created page with '= SPI connector pinout = For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable. The pinout is the same (or very similar) t…'
wikitext
text/x-wiki
= SPI connector pinout =
For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable.
The pinout is the same (or very similar) to the pinout of the 6-pin ICSP programming connector that lots of AVR boards have.
{| border=1
! pin !! function !! remark
|-
| 1 || MISO || Master In Slave Out
|-
| 2 || VCC || power
|-
| 3 || SCK || Shift Clock
|-
| 4 || MOSI || Master Out Slave In.
|-
| 5 || SS || Slave Select
|-
| 6 || GND || Ground 0V
|-
|}
The connector is laid out as follows:
{| border=1
|-
| 1 || 2
|-
| 3 || 4
|-
| 5 || 6
|-
|}
The board usually has pin 1 and six marked.
a261a0c7a7de1f9df24da9a8697c554401f53d1b
385
384
2012-02-07T16:13:28Z
Rew
3
/* SPI connector pinout */
wikitext
text/x-wiki
For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable.
The pinout is the same (or very similar) to the pinout of the 6-pin ICSP programming connector that lots of AVR boards have.
{| border=1
! pin !! function !! remark
|-
| 1 || MISO || Master In Slave Out
|-
| 2 || VCC || power
|-
| 3 || SCK || Shift Clock
|-
| 4 || MOSI || Master Out Slave In.
|-
| 5 || SS || Slave Select
|-
| 6 || GND || Ground 0V
|-
|}
The connector is laid out as follows:
{| border=1
|-
| 1 || 2
|-
| 3 || 4
|-
| 5 || 6
|-
|}
The board usually has pin 1 and six marked.
fddb2635254be709bbfeaf72a0cc7756a3c03a40
7FETs
0
49
409
310
2012-02-09T08:07:00Z
Rew
3
/* Overview */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_6FETs PCB|The SPI_6FETs PCB]]
This is the documentation page for the SPI_6FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c48dd4daf50327671e6d7fdeeb614f51cc3a937d
USB-multio
0
46
424
349
2012-02-13T10:10:19Z
Rew
3
/* Windows */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [http://www.bitwizard.nl/wiki/index.php/RGB_clock RGB LED Clock]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
41b19a3cb8c550ac13eca3f28b116212f102c433
Spi lcd 1.2 protocol
0
111
428
2012-02-14T09:43:22Z
Rew
3
Created page with 'To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82). Bytes above 0xf0 ar…'
wikitext
text/x-wiki
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
78e22d0f2a007f4b3816e852cc95fc07af5f6d28
437
428
2012-02-14T10:20:50Z
Rew
3
wikitext
text/x-wiki
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0xf1 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
28f27e5455b3425d3cb02667c24c3939eb89ac0f
438
437
2012-02-14T10:21:11Z
Rew
3
/* set cursor position */
wikitext
text/x-wiki
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0xf0 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
434b071fb5035b388bf5345705929ec7c4c53ae8
SPI LCD
0
48
429
405
2012-02-14T09:43:39Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Initial public release
79149b3071d15303583e9212e4e5f43b6d2b3f25
439
429
2012-02-14T10:23:41Z
Rew
3
/* Future software enhancements */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
c2fcce45ff1c5334324888c9123b098c4e8b765a
440
439
2012-02-14T10:24:01Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
dfc587f096e4b82cb1e2cc91d06e90670e4dcf8e
444
440
2012-02-14T10:58:01Z
Rew
3
/* Assembly instructions */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
d7d062d42b00d55ec7547744de5be6f70331ee30
445
444
2012-02-14T10:59:01Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
== External resources ==
=== Datasheets ===
the fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
the CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
77720b398c0f9bf8d2d03abef21a4fa098f2bbdf
463
445
2012-02-15T17:06:48Z
Tom
4
/* External resources */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
c015bdb0def3cc407e61525d6cb62c944ecca4cc
Spi lcd 1.3 protocol
0
112
430
2012-02-14T09:53:59Z
Rew
3
Created page with 'Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address. Afte…'
wikitext
text/x-wiki
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to x, y. y is the top 3 bits, x is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
1919bc9acad9d1c69b285457403bc4293eb93c9d
431
430
2012-02-14T10:00:21Z
Rew
3
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to x, y. y is the top 3 bits, x is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string.
|-
| 0x02 || read eeprom (serial number).
|}
12698fcf1574de9689c982b1b3fe9fa0f588ca54
432
431
2012-02-14T10:13:03Z
Rew
3
/* read ports */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to x, y. y is the top 3 bits, x is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
read identification:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
Send data:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
7f318bc5647cc1aebb0e883399fdcafe1dc11274
433
432
2012-02-14T10:14:39Z
Rew
3
/* write ports */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
read identification:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
Send data:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
7b833457a1d01af0e277de694e137c5c859f51e4
434
433
2012-02-14T10:16:26Z
Rew
3
/* examples */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
0ffdf11cae3074c935ca2a8350d5b1716ae5c1f0
435
434
2012-02-14T10:17:16Z
Rew
3
/* Send text to display */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
0ba7a7296e1ab026f827bd35f2b0a734d1cb2017
436
435
2012-02-14T10:19:18Z
Rew
3
/* read identification */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
65e778d9fe6850bdbf497b875654e2e8c861a706
7FETs
0
49
441
409
2012-02-14T10:39:47Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_6FETs PCB|The SPI_6FETs PCB]]
This is the documentation page for the SPI_6FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
bc1d4a0b620cb9e6980f3117a51081f0915c32fc
442
441
2012-02-14T10:46:16Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_6FETs PCB|The SPI_6FETs PCB]]
This is the documentation page for the SPI_6FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
8b6f8362e857d44f5502180d3584f23bf22e2515
443
442
2012-02-14T10:56:37Z
Rew
3
/* Future software enhancements */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_6FETs PCB|The SPI_6FETs PCB]]
This is the documentation page for the SPI_6FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
af641114c9a2488df65217d7728c6982dcde802a
457
443
2012-02-15T14:32:57Z
Tom
4
moved [[SPI 6FETs]] to [[SPI 7FETs]]
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_6FETs PCB|The SPI_6FETs PCB]]
This is the documentation page for the SPI_6FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
af641114c9a2488df65217d7728c6982dcde802a
460
457
2012-02-15T14:33:24Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_6FETs PCB|The SPI_6FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
b9c54982adb6ceeba32968670c4207a6becf544b
SPI 6FETs
0
124
458
2012-02-15T14:32:57Z
Tom
4
moved [[SPI 6FETs]] to [[SPI 7FETs]]
wikitext
text/x-wiki
#REDIRECT [[SPI 7FETs]]
e7bb87693756dcaf9ff515e46e1410636abb060a
Main Page
0
1
459
406
2012-02-15T14:33:08Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
* Kits
** [[RGB clock]]
* Preparing your developement environment
** [[Linux]]
** [[Windows]]
** [[MacOS]]
* Developement boards
** [[FTDI_ATmega]]
** [[USB-multio]]
** [[usbbigmultio]]
** [[Cyclone dev board]]
* Expansion boards
** [[SPI_LCD]]
** [[SPI_7FETs]]
** [[SPI_Servo]]
** [[SPI_LM35]]
** [[SPI_DIO]]
** [[SPI_relay]]
** [[16 LEDs]]
* Breakout boards
** [[FT245RL breakout board]]
** [[FT2232H breakout board]]
** [[Raspberry Pi Serial]]
* Other boards
** [[USB-SATA powerswitch]]
** [[USB-opto]]
** [[Servotester]]
** [[FTDI serial]]
* Miscellaneous
** [[Solder jumpers]]
** [[raspberry pi expansion system page]]
** [[template]]
20425af5138ddfa794fd448894d2d1407f3429de
486
459
2012-02-18T15:51:03Z
Rew
3
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[FTDI serial]]
= Miscellaneous =
* [[Solder jumpers]]
* [[raspberry pi expansion system page]]
* [[template]]
b512ef541c044131d85c5b36f319dccac277d7f1
487
486
2012-02-18T15:51:28Z
Rew
3
/* Miscellaneous */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[FTDI serial]]
= Miscellaneous =
* [[Solder jumpers]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
c930e1b7790af4a945397153818b012a46bb222a
496
487
2012-02-20T22:11:22Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[FTDI serial]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Miscellaneous =
* [[Solder jumpers]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
cdb0f17e316b9fa08021ed1f6f18973e072839bd
525
496
2012-02-22T16:49:40Z
Tom
4
/* Other boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Miscellaneous =
* [[Solder jumpers]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
f95dea8e9f5e771b6aebc18faded3c526f543574
526
525
2012-02-22T16:49:48Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Miscellaneous =
* [[Solder jumpers]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
98742db61c3797cba28920b089a8967084b02b9e
Servo
0
50
462
312
2012-02-15T17:01:40Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.
1-2: Default: Both SPI connectors connected in parallel.
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
* Add extra power connector for servo power
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
cabc02f1e55e98b985ab13e0c2c067756a855863
464
462
2012-02-15T17:09:22Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.
1-2: Default: Both SPI connectors connected in parallel.
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
* Add extra power connector for servo power
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
b078daf00bbbf9af9164da919b8ea176c38178f8
476
464
2012-02-17T15:17:04Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.
1-2: Default: Both SPI connectors connected in parallel.
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
* Add extra power connector for servo power
* Add possibility to disconnect servo-power from VCC
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
bf6d36a5119b7e039eb647f5d2e663be19f0447a
477
476
2012-02-17T15:17:51Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.<br>
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
* Add extra power connector for servo power
* Add possibility to disconnect servo-power from VCC
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
814efa53c45b19f100c696b1ca8f8a998c2a92c4
478
477
2012-02-17T15:20:50Z
Tom
4
/* Overview */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.<br>
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.<br>
<br>
For small servos, the power supplied by the SPI connector is enough. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and cutting the trace connecting the servo power rail to the SPI power rail. Future versions will have a jumper for this cause, and a dedicated servo power connector.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.<br>
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
* Add extra power connector for servo power
* Add possibility to disconnect servo-power from VCC
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0ea1dbf2f743138979d4de797e91499349fbfa2b
479
478
2012-02-17T15:46:24Z
Tom
4
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.<br>
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.<br>
<br>
For small servos, the power supplied by the SPI connector is enough. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and cutting the trace connecting the servo power rail to the SPI power rail. Future versions will have a jumper for this cause, and a dedicated servo power connector.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.<br>
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ae1ae992db2bc6598d5c92ce5913a0ec76d2b630
480
479
2012-02-17T15:47:10Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.<br>
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.<br>
<br>
For small servos, the power supplied by the SPI connector is enough. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and cutting the trace connecting the servo power rail to the SPI power rail. Future versions will have a jumper for this cause, and a dedicated servo power connector.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.<br>
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external_ servo power.
=== 1.0 ===
* Initial public release
77700b8d91d80b824dd3fe6aed01f30bb88768aa
481
480
2012-02-17T15:47:17Z
Tom
4
/* 1.2 */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.<br>
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.<br>
<br>
For small servos, the power supplied by the SPI connector is enough. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and cutting the trace connecting the servo power rail to the SPI power rail. Future versions will have a jumper for this cause, and a dedicated servo power connector.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.<br>
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
d586d290248ed4209e374889c54d9919584eb609
Servo 1.0 protocol
0
126
465
2012-02-15T18:14:24Z
Tom
4
Created page with 'The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read trans…'
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_servo board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
d22245acb94481bacc7ed72cefd26de79e88a27f
668
465
2012-02-27T10:04:08Z
Rew
3
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_servo board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
The default address of the servo board is 0x86.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
9bcd3ed269304b57c98c80f4f37b7ece8438e5e5
RGB clock
0
25
466
408
2012-02-15T18:48:40Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
===== Mode 4 =====
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward
Switch 3: Push to jump 1 minute forward
Switch 4: Push to reset the seconds to 0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
55ae8dd56eadaf29110792836a248cc33ffcf266
Raspberry pi expansion system page
0
86
485
374
2012-02-18T15:49:33Z
Rew
3
/* expansion boards */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
The following expansion boards have been designed:
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
These expansion boards have two SPI connectors. The first SPI connector is for data transfer during normal operation. The other can be used to daisy-chain the SPI bus to other SPI expansion boards. Or it can be configured to be used as the programming port for the onboard AVR chip.
It should be possible to use one of the raspberry pi SPI buses for data-transfer, while you use the other one to program the AVR chip on the expansion board.
28968704c24bd7338584b993ca00cc1bbddb4aaa
Nikon D80 wired remote
0
140
489
2012-02-18T15:59:44Z
Rew
3
Created page with ' I'm working on a "gigapan" like system that will take a panorama. For this my board will have to tell the camera to take a picture. A hack would be to use a servo and push the s…'
wikitext
text/x-wiki
I'm working on a "gigapan" like system that will take a panorama. For this my board will have to tell the camera to take a picture. A hack would be to use a servo and push the shutter button, but a wired remote would give more reliable results.
Somehow, I had come to think that instead of pulling pins to ground, my camera had a pin connected to VCC and that we had to pull things up to that voltage level. However things were not working properly.
This seems NOT to be the case!
The situation is as follows.
My (cheap) wired remote cable has three wires, white, yellow and red. white is GND, red is FOCUS and yellow is SHUTTER.
In rest you can measure about 5V on the FOCUS pin (I've observed 4.3V). To activate the focus, pull the FOCUS pin low. At this moment, the camera will enable the pullup on the SHUTTER button. Before that it won't be able to see you connecting it to ground because it already IS at ground. To trigger a snapshot, pull SHUTTER low.
a64c3ffee6fc922c2b0be0b33e4178010acccfd6
490
489
2012-02-18T16:03:05Z
Rew
3
wikitext
text/x-wiki
I'm working on a "gigapan" like system that will take a panorama. For this my board will have to tell the camera to take a picture. A hack would be to use a servo and push the shutter button, but a wired remote would give more reliable results.
Somehow, I had come to think that instead of pulling pins to ground, my camera had a pin connected to VCC and that we had to pull things up to that voltage level. However things were not working properly.
This seems NOT to be the case!
The situation is as follows.
My (cheap) wired remote cable has three wires, white, yellow and red. white is GND, red is FOCUS and yellow is SHUTTER.
In rest you can measure about 5V on the FOCUS pin (I've observed 4.3V). To activate the focus, pull the FOCUS pin low. At this moment, the camera will enable the pullup on the SHUTTER button. Before that it won't be able to see you connecting it to ground because it already IS at ground. To trigger a snapshot, pull SHUTTER low.
Luckily, instead of tying one pin directly to VCC, I tied all three camera pins to an IO. When I thought that one of them was tied to VCC in the camera, I simply programmed that pin as an output-high. Now that things seem to be the other way around, it's just a matter of changing the firmware. The ground pin will have to be programmed output-low.
d9c1fe920e45aa0a03d00f4771bbe385c8509235
Windows
0
146
497
2012-02-20T23:02:13Z
Tom
4
Created page with '= UNDER CONSTRUCTION = At the moment, this page is still heavily under construction. You can check one of the following howtos in the meantime: [http://www.atmel.com/microsite/av…'
wikitext
text/x-wiki
= UNDER CONSTRUCTION =
At the moment, this page is still heavily under construction. You can check one of the following howtos in the meantime:
[http://www.atmel.com/microsite/avr_studio_5/default.aspx]
[http://www.ladyada.net/learn/avr/]
[http://hackaday.com/2010/10/23/avr-programming-introduction/]
= Goal of this page =
On this page, we will explain how to prepare your developement environment, and how to write, compile, and flash your programs. However, we will not teach you the art of programing itself.
= Downloading the software =
Make sure to download all the latest versions, as always.
== Compiler and IDE ==
* [http://sourceforge.net/projects/winavr/files/WinAVR/ WinAVR]
* [http://www.atmel.com/tools/ATMELAVRSTUDIO.aspx Atmel AVR studio] (optional)
== Editors ==
* [http://notepad-plus-plus.org/download/ Notepad++] My personal favourite.
== Programming software ==
* [http://www.atmel.com/tools/FLIP.aspx Flip] (for programming Atmel USB controllers with a bootloader, over USB)
= Installing everything =
== WinAVR ==
Simply run the executable setup file, and keep clicking "yes" and "next", no specific user input required.
== Atmel AVR Studio ==
== Notepad++ ==
== Flip ==
= Creating a project =
= Compiling a project =
= Uploading a hex file to an AVR =
421f556bf88ed94a0924c4f858beb88caf78b56c
498
497
2012-02-20T23:03:48Z
Tom
4
/* UNDER CONSTRUCTION */
wikitext
text/x-wiki
= UNDER CONSTRUCTION =
At the moment, this page is still heavily under construction. You can check one of the following howtos in the meantime:<br>
[http://www.atmel.com/microsite/avr_studio_5/default.aspx Atmel AVR Studio 5]<br>
[http://www.ladyada.net/learn/avr/ Ladyada]<br>
[http://hackaday.com/2010/10/23/avr-programming-introduction/ Hackaday]<br>
= Goal of this page =
On this page, we will explain how to prepare your developement environment, and how to write, compile, and flash your programs. However, we will not teach you the art of programing itself.
= Downloading the software =
Make sure to download all the latest versions, as always.
== Compiler and IDE ==
* [http://sourceforge.net/projects/winavr/files/WinAVR/ WinAVR]
* [http://www.atmel.com/tools/ATMELAVRSTUDIO.aspx Atmel AVR studio] (optional)
== Editors ==
* [http://notepad-plus-plus.org/download/ Notepad++] My personal favourite.
== Programming software ==
* [http://www.atmel.com/tools/FLIP.aspx Flip] (for programming Atmel USB controllers with a bootloader, over USB)
= Installing everything =
== WinAVR ==
Simply run the executable setup file, and keep clicking "yes" and "next", no specific user input required.
== Atmel AVR Studio ==
== Notepad++ ==
== Flip ==
= Creating a project =
= Compiling a project =
= Uploading a hex file to an AVR =
cbd9056b08cb1c624f2cf882861ee27f790f1f82
FTDI serial
0
19
521
140
2012-02-22T16:02:11Z
Tom
4
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
1.0
* Initial public release
2c07e1e35f55f465dcb377c1ff4089c8567ef626
527
521
2012-02-22T16:51:08Z
Tom
4
/* Changelog */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
93c69b6a589a556c6e8965dd46a228d8fc345d5b
FTDI ATmega
0
6
524
348
2012-02-22T16:45:01Z
Tom
4
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
8e07ca9ce56918241d4bc599d421fe39a22cf879
549
524
2012-02-23T10:01:42Z
AngelicaByrd
127
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors. In order to find some time for myself I decided to search for service that could supply me with the prime quality [http://www.qualityessay.com/custom-essays.html custom essays] at prices that would be reasonable enough. The final choice was QualityEssay.Com as they did have an excellent reputation.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
c4a7f9c694e1fba4435baa3dd3778ba46ad6b78a
551
549
2012-02-23T13:13:46Z
Tom
4
Reverted edits by [[Special:Contributions/AngelicaByrd|AngelicaByrd]] ([[User talk:AngelicaByrd|Talk]]) to last revision by [[User:Tom|Tom]]
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board.
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
TODO: port the fast ftdi bitbang code to libftdi and submit to avrdude.
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
8e07ca9ce56918241d4bc599d421fe39a22cf879
SPI LCD
0
48
674
463
2012-02-28T07:06:32Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[spi_connectors]]
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
8ebfe072384c4127aed89bcceb30556a6b3b17bb
675
674
2012-02-28T07:07:38Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[SPI connector pinout]]
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
e0d381f71b277ed7b731b1d813e369867e66d37c
678
675
2012-02-28T07:15:32Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
The second SPI port can be used as an ICSP connector.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[SPI connector pinout]]
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
d4d7603f30f849c47260aa351f2ad81a0f253526
681
678
2012-02-28T13:30:03Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
The second SPI port can be used as an ICSP connector.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[SPI connector pinout]]
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] .
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
63decf1cceb8f035a2196c81084a20b0b9d70ca3
682
681
2012-02-28T13:31:33Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
The second SPI port can be used as an ICSP connector.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[SPI connector pinout]]
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] . This appplication was written for the ftdi_atmega board from bitwizard, but can also be used on an arduino. But you'll have to download the hex to your board by hand after compiling.
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
3cedbdc9708c8d0944b09ffa8886a54a8e202c3c
683
682
2012-02-28T16:29:49Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
The second SPI port can be used as an ICSP connector.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[SPI connector pinout]]
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus.
In the other configuration, the second SPI connector is the ICSP connector.
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration.
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] . This appplication was written for the ftdi_atmega board from bitwizard, but can also be used on an arduino. But you'll have to download the hex to your board by hand after compiling.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [[http://www.bitwizard.nl/software the bitwizard software download directory]] .
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
00d6f9d1bec25a967128e24d2e1f20a5ed8313ea
726
683
2012-03-02T16:00:53Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
The second SPI port can be used as an ICSP connector.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[SPI connector pinout]]
=== LEDs ===
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration. <br>
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] . This appplication was written for the ftdi_atmega board from bitwizard, but can also be used on an arduino. But you'll have to download the hex to your board by hand after compiling.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [[http://www.bitwizard.nl/software the bitwizard software download directory]] .
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
bfe8d7c5775114fef24e99c2e1d33ae5adefa7da
SPI connector pinout
0
87
676
385
2012-02-28T07:14:16Z
Rew
3
wikitext
text/x-wiki
For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable.
The pinout is the same (or very similar) to the pinout of the 6-pin ICSP programming connector that lots of AVR boards have.
{| border=1
! pin !! function !! remark
|-
| 1 || MISO || Master In Slave Out
|-
| 2 || VCC || power
|-
| 3 || SCK || Shift Clock
|-
| 4 || MOSI || Master Out Slave In.
|-
| 5 || SS || Slave Select
|-
| 6 || GND || Ground 0V
|-
|}
The connector is laid out as follows:
{| border=1
|-
| 1 || 2
|-
| 3 || 4
|-
| 5 || 6
|-
|}
The board usually has pin 1 and six marked.
== Connecting the bitwizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin
|-
| 1 || MISO || 12
|-
| 2 || VCC || 5V
|-
| 3 || SCK || 13
|-
| 4 || MOSI || 11
|-
| 5 || SS || 10
|-
| 6 || GND || Ground 0V
|-
|}
You could use other pins, but then you have to make a software SPI implementation. This is not too difficult, but might be neccesary if something else is already on the SPI pins. On the other hand, you might be able to still use the hardware SPI module by just moving the "SS" pin somewhere else.
b87219df5a1e3b5027c61b08de2b5ac902602ce9
677
676
2012-02-28T07:14:44Z
Rew
3
/* Connecting the bitwizard boards to an Arduino */
wikitext
text/x-wiki
For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable.
The pinout is the same (or very similar) to the pinout of the 6-pin ICSP programming connector that lots of AVR boards have.
{| border=1
! pin !! function !! remark
|-
| 1 || MISO || Master In Slave Out
|-
| 2 || VCC || power
|-
| 3 || SCK || Shift Clock
|-
| 4 || MOSI || Master Out Slave In.
|-
| 5 || SS || Slave Select
|-
| 6 || GND || Ground 0V
|-
|}
The connector is laid out as follows:
{| border=1
|-
| 1 || 2
|-
| 3 || 4
|-
| 5 || 6
|-
|}
The board usually has pin 1 and six marked.
== Connecting the bitwizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin
|-
| 1 || MISO || 12
|-
| 2 || VCC || 5V
|-
| 3 || SCK || 13
|-
| 4 || MOSI || 11
|-
| 5 || SS || 10
|-
| 6 || GND || Gnd
|-
|}
You could use other pins, but then you have to make a software SPI implementation. This is not too difficult, but might be neccesary if something else is already on the SPI pins. On the other hand, you might be able to still use the hardware SPI module by just moving the "SS" pin somewhere else.
159a1d22a944ef0cf3849df38e4750a59e93b4a8
Main Page
0
1
679
526
2012-02-28T13:14:39Z
Tom
4
/* Miscellaneous */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
c6f18c83f3c07741f750580c687b275299d9213e
887
679
2012-03-12T13:44:31Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
af38e6c41af7aa4dfc580a68d6bb836cefa99e27
889
887
2012-03-12T13:49:45Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
* [[Default addresses]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
992c1fb7d6e79140a42e6ab7839c5ce1558ec312
Temperature Interface
0
51
723
302
2012-03-02T14:37:12Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
76f8491805cc152840c170f0a0f7c6f0c5f66158
724
723
2012-03-02T14:47:16Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
dda8f588cbdbfd0b32c30ddfcef4bf87c35ccc05
725
724
2012-03-02T14:47:58Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
2221a4a5abbed8cc57ab011afdfa5a025174ae5d
FTDI ATmega
0
6
727
551
2012-03-02T16:18:09Z
Tom
4
/* Linux */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 should be in the lower position.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
9476a13f749217d46cda68f8c70e02d906e67d85
728
727
2012-03-02T16:18:56Z
Tom
4
/* Linux */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 should be in the lower position.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
93c49dea40364a26a39a8d712c10080743d977c5
853
728
2012-03-09T12:42:27Z
Rew
3
/* Arduino Pinout */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 should be in the lower position.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
2130315b71854d274cc6532ab5e4b1552b187a07
854
853
2012-03-09T12:52:27Z
Rew
3
/* Use as a programmer */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 should be in the lower position.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
9bbdd045b98a65b273f56a57546923e3222a19a4
855
854
2012-03-09T12:55:21Z
Rew
3
/* Linux */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
e039e9480bb797cb753b4d3bd589fc5378d0ff54
856
855
2012-03-09T12:57:14Z
Rew
3
/* Arduino Pinout */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
698bf2f36eac7a5f981a2a80d4e4bac3d9f1b9ee
7FETs
0
49
729
460
2012-03-02T16:54:42Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
0fa2af813b63666977f9cc81eeac036ad672edb4
812
729
2012-03-07T17:21:03Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]]
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This has routines to send things using SPI to the board, although the actual demo is written for the LCD board.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
fc5ce2a4234d058514d8f1885e3ac5ccfb8d8f10
815
812
2012-03-07T18:09:17Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
7422863b209d734fc820b3ce37903b5d22753558
816
815
2012-03-07T18:13:37Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
the fets: [[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf]]
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
d55f1c739b9316bb3f29493b423e2a98a1f7d449
817
816
2012-03-07T18:33:30Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
== Specifications ==
The 7fets board is capable of sinking about 1A per output. We have tested 1.25A and the fet became slightly warm, as predicted by theory.
Although the specifications for the fets allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
the fets: [[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf]]
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
82306efa60369d8bc831b50f6b70ff82690479a4
818
817
2012-03-07T18:33:53Z
Rew
3
/* Assembly instructions */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None the board comes assembled.
== Specifications ==
The 7fets board is capable of sinking about 1A per output. We have tested 1.25A and the fet became slightly warm, as predicted by theory.
Although the specifications for the fets allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
the fets: [[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf]]
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
cffcf2fcef086ea5604233d2beff36e0a10a4231
819
818
2012-03-07T18:34:01Z
Rew
3
/* Assembly instructions */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes assembled.
== Specifications ==
The 7fets board is capable of sinking about 1A per output. We have tested 1.25A and the fet became slightly warm, as predicted by theory.
Although the specifications for the fets allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
the fets: [[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf]]
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
db78c150b37888c135806709669489c9f94d3027
824
819
2012-03-07T18:41:56Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes assembled.
== Specifications ==
The 7fets board is capable of sinking about 1A per output. We have tested 1.25A and the fet became slightly warm, as predicted by theory.
Although the specifications for the fets allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
the fets: [[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf]]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT7 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max 4xx mA!)
Use a connector on 1-2 to provide a more powerful powersource for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
e93ca7e9ff1352ab2a4f8d6deef0cac7be5c0ca6
828
824
2012-03-08T09:18:01Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7fets board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max 4xx mA!)
Use a connector on 1-2 to provide a more powerful powersource for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
f35aa0f596e0946df5d7943d2ecb59a4e6f5ec72
Spi lcd 1.3 protocol
0
112
777
436
2012-03-05T10:08:33Z
Rew
3
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
43dfce92c13d637a1e36f5b6a138f4b5d55721ed
General SPI protocol
0
401
778
2012-03-05T10:19:21Z
Rew
3
Created page with " BitWizard expansion boards communicate with SPI. SPI is a well-known synchronous protocol, but not very well standardized. Many implementations require a separate "CS" line..."
wikitext
text/x-wiki
BitWizard expansion boards communicate with SPI.
SPI is a well-known synchronous protocol, but not very well standardized. Many implementations require a separate "CS" line to each chip connected to the SPI bus. The BitWizard implementation does not have this requirement. This allows us to daisy chain a large number of boards without requiring an extra pin for every board.
The slaves use an ATTINY44 processor. These have a hardware universal serial interface (USI) module that can be configured as "SPI slave". Many things however have to be processed in software. This means that some time is required between each byte. This time is 20 microseconds. This is the time between sucessive bytes, not the dead time between bytes.
You can choose a clock frequency that suits you. The maximum is 2MHz. At 2MHz, transmitting one byte takes 4 mircoseconds, so a delay of 16 microseconds between bytes is required.
At 0.625MHz, transmission of a byte takes 12.8 microseconds, so a delay between bytes of only 7.2 microseconds is required.
With new firmware written in assembly (or at least the interrupt handler routine) this might be improved.
9867b8a101c76819cc034c719aa468cda484a12d
779
778
2012-03-05T11:04:41Z
Rew
3
wikitext
text/x-wiki
BitWizard expansion boards communicate with SPI.
SPI is a well-known synchronous protocol, but not very well standardized. Many implementations require a separate "CS" line to each chip connected to the SPI bus. The BitWizard implementation does not have this requirement. This allows us to daisy chain a large number of boards without requiring an extra pin for every board.
= timing =
The slaves use an ATTINY44 processor. These have a hardware universal serial interface (USI) module that can be configured as "SPI slave". Many things however have to be processed in software. This means that some time is required between each byte. This time is 20 microseconds. This is the time between sucessive bytes, not the dead time between bytes.
You can choose a clock frequency that suits you. The maximum is 2MHz. At 2MHz, transmitting one byte takes 4 mircoseconds, so a delay of 16 microseconds between bytes is required.
At 0.625MHz, transmission of a byte takes 12.8 microseconds, so a delay between bytes of only 7.2 microseconds is required.
With new firmware written in assembly (or at least the interrupt handler routine) this might be improved.
= protocol =
To send a sequence of bytes to the slave SPI device, the master starts by pulling the SS line low. All slaves are now primed to receive an "address" byte. Next the master sends the address byte.
After this the protocol in theory depends on which slave you are talking to. In practice so far it is convenient to make the slaves talk a similar protocol: the next byte specifies a "register" or "port" address. After this you can send data to that port or register.
If the data can be considered a "data stream" like with the SPI_LCD board, you can call it a "port". If there is just a single value, it is more common to call it a register.
d9c77facbe53c8dc726d4a0b7f12c6a9837c998e
780
779
2012-03-05T11:09:26Z
Rew
3
wikitext
text/x-wiki
BitWizard expansion boards communicate using an SPI protocol.
SPI is a well-known synchronous protocol, but not very well standardized. Many implementations require a separate "CS" line to each chip connected to the SPI bus. The BitWizard implementation does not have this requirement. This allows us to daisy chain a large number of boards without requiring an extra pin for every board.
= timing =
The slaves use an ATTINY44 processor. These have a hardware universal serial interface (USI) module that can be configured as "SPI slave". Many things however have to be processed in software. This means that some time is required between each byte. This time is 20 microseconds. This is the time between sucessive bytes, not the dead time between bytes.
You can choose a clock frequency that suits you. The maximum is 2MHz. At 2MHz, transmitting one byte takes 4 mircoseconds, so a delay of 16 microseconds between bytes is required.
At 0.625MHz, transmission of a byte takes 12.8 microseconds, so a delay between bytes of only 7.2 microseconds is required.
With new firmware written in assembly (or at least the interrupt handler routine) this might be improved.
= protocol =
To send a sequence of bytes to the slave SPI device, the master starts by pulling the SS line low. All slaves are now primed to receive an "address" byte. Next the master sends the address byte.
After this the protocol in theory depends on which slave you are talking to. In practice so far it is convenient to make the slaves talk a similar protocol: the next byte specifies a "register" or "port" address. After this you can send data to that port or register.
If the data can be considered a "data stream" like with the SPI_LCD board, you can call it a "port". If there is just a single value, it is more common to call it a register.
1f6a6e78ddacaa530a7d22c4d27daa62c0a0cf32
DIO protocol
0
432
813
2012-03-07T18:03:51Z
Rew
3
Created page with " The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read t..."
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x40 || set/read current position.
|-
| 0x41 || set/read target position.
|-
| 0x42 || set/read relative position.
|-
| 0x43 || set/read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
abe0ad83a185617585908cce915c00ce6eb3beba
814
813
2012-03-07T18:07:00Z
Rew
3
/* set cursor position */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x40 || set/read current position.
|-
| 0x41 || set/read target position.
|-
| 0x42 || set/read relative position.
|-
| 0x43 || set/read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x10 || xx || port 0x10 all outputs in bitpattern.
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
44f152f64179bc1670a004a46594e6e486fc5a04
RGB clock
0
25
820
466
2012-03-07T18:37:42Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
===== Mode 4 =====
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward
Switch 3: Push to jump 1 minute forward
Switch 4: Push to reset the seconds to 0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss:milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
aa64e5465d1027c751412869bb41ddcf4f930e8b
881
820
2012-03-12T11:45:04Z
Tom
4
/* Reading back the time */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
===== Mode 4 =====
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward
Switch 3: Push to jump 1 minute forward
Switch 4: Push to reset the seconds to 0
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0020495c3ecf370f6836e877f34a925e395f451c
882
881
2012-03-12T11:48:32Z
Tom
4
/* Using the pushbuttons */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included. These can be accessed with the "m" command.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
===== Mode 0 (default)=====
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Mode 1 =====
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 2 =====
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
===== Mode 3 =====
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
===== Mode 4 =====
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
7fa4e6cca08b6f0f5016dde766310fe366893bd2
883
882
2012-03-12T11:55:46Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
REW: Hmm. Apparently the defaults do not listen to me. :-(<br>
Tom: They do to me...
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
931370ce25586c90340463bc9b6cb92a0347fcdb
884
883
2012-03-12T11:57:08Z
Tom
4
/* Adjusting the white-balance */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
==== alternative use ====
* If you want to measure the powerconsumption of the LEDs, you can connect your ammeter here.
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5af99b92a3cfa44350d30a171e101b2aae7c9c71
885
884
2012-03-12T12:25:20Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Sllows you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
d6248c90bc6fa2b9721a2f2ef15deb3b2394bfa7
886
885
2012-03-12T12:26:15Z
Tom
4
/* Mode 2 */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and green is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
25da86c74301391f2cf962871d68beda64768462
Usbio ACM sample program
0
4
821
34
2012-03-07T18:39:49Z
Tom
4
/* download */
wikitext
text/x-wiki
== usbio sample ACM program ==
The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board.
Under Linux if you connect your usbio board when it is loaded with this program, you will get a /dev/ttyACM0 device.
Under windows you will have to follow the directions of the LUFA documentation which include downloading and using the INF file located: https://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/LUFA%20VirtualSerial.inf?r=1607
The LUFA explanation is here: http://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt?spec=svn1470&r=1470
Once you have the driver sorted, you can use any terminal program you like to connect with the board. I use "kermit" to communicate with serial devices like this. There are several other programs available, but I'm used to kermit. Under windows there is a program called hyperterm.
Once you connect to the device, you will be prompted with a welcome string and a prompt. You can use several commands:
=== s ===
if you type s<outputnumber> the output with that number will go high. Outputnumber is in hex. For usbio the output numbers go from 0 to f. For example s5 will turn on output 5.
=== c ===
if you type c<outputnumber> the output with that number will be cleared. For example: ce will clear output 14 (which is e in hex).
=== a ===
If you type a<output> <value> the output will be put in software pwm mode. Currently values 0...80 are supported (128 levels).
=== p ===
If you type p <output> <length> the output with that number will be pulsed for <length> ms. The length is of course in hex.
=== z ===
If you type "z" the board will reset into firmware-upload-mode.
== download ==
You can download the source from: http://www.bitwizard.nl/software/usbio.tgz
You then need to download LUFA, and place it in the directory usbio/../LUFA (i.e. next to the usbio directory).
== future enhancements ==
In the future we'll enhance the program to allow setting the mode of pins to inputs. And the program should be able to monitor the inputs value, and report the state changes as they happen. Also on-demand questioning of the inputs should become possible.
bd4dd79f9efd3bdcb897b2f280030989d4edf4db
Usbio kitt
0
3
822
33
2012-03-07T18:40:05Z
Tom
4
/* usbio Kitt */
wikitext
text/x-wiki
== usbio Kitt ==
The usbio kitt is a sample program. It runs on the [[usbio]].
It is very basic in that it only uses generic AVR IO ports and not the USB functions of the device. The board will not enumerate on the USB bus when this demo is loaded.
The source code can be downloaded from http://www.bitwizard.nl/software/kitt.tgz
2ab5aa2a67d13cea021b90377bab7b8063c6262c
USB-multio
0
46
823
424
2012-03-07T18:41:54Z
Tom
4
/* Additional software */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
8c06f8e6fd79bea14324624efd20824341a6bb5b
Modifying the arduino IDE for 20MHz
0
460
857
2012-03-09T13:06:41Z
Rew
3
Created page with " = Modifying the arduino IDE for 20MHz = Moogle writes: open up boards.txt and add the following to the top ###########################################################..."
wikitext
text/x-wiki
= Modifying the arduino IDE for 20MHz =
Moogle writes:
open up boards.txt and add the following to the top
##############################################################
pro328_20.name=Arduino pro 328 20mhz
pro328_20.upload.protocol=stk500
pro328_20.upload.maximum_size=30720
pro328_20.upload.speed=57600
pro328_20.bootloader.low_fuses=0xFF
pro328_20.bootloader.high_fuses=0xDA
pro328_20.bootloader.extended_fuses=0×05
pro328_20.bootloader.path=atmega
pro328_20.bootloader.file=ATmegaBOOT_168_atmega328_20.hex
pro328_20.bootloader.unlock_bits=0x3F
pro328_20.bootloader.lock_bits=0x0F
pro328_20.build.mcu=atmega328p
pro328_20.build.f_cpu=20000000L
pro328_20.build.core=arduino
From: http://wtfmoogle.com/?p=1381
The bootloader also needs modification to run at
dfc751a948ec5aa1b5aa3211a07b7260461b512f
864
857
2012-03-10T09:25:22Z
Tom
4
wikitext
text/x-wiki
= Modifying the arduino IDE for 20MHz =
Moogle writes:
open up boards.txt and add the following to the top
##############################################################
pro328_20.name=Arduino pro 328 20mhz
pro328_20.upload.protocol=stk500
pro328_20.upload.maximum_size=30720
pro328_20.upload.speed=57600
pro328_20.bootloader.low_fuses=0xFF
pro328_20.bootloader.high_fuses=0xDA
pro328_20.bootloader.extended_fuses=0×05
pro328_20.bootloader.path=atmega
pro328_20.bootloader.file=ATmegaBOOT_168_atmega328_20.hex
pro328_20.bootloader.unlock_bits=0x3F
pro328_20.bootloader.lock_bits=0x0F
pro328_20.build.mcu=atmega328p
pro328_20.build.f_cpu=20000000L
pro328_20.build.core=arduino
From: http://wtfmoogle.com/?p=1381
The bootloader also needs modification to run at
9ec9c0bbf5dddeec8a243ba52d2dd698dee86e6e
3FETs
0
483
888
2012-03-12T13:48:13Z
Tom
4
Created page with "This is the documentation page for the SPI_3FETs board. == Overview == The board has 3 fets that allow you to pull a pin of a load low. You would normally tie the other end..."
wikitext
text/x-wiki
This is the documentation page for the SPI_3FETs board.
== Overview ==
The board has 3 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 5A per output should be possible. Maximum voltage is 30V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3fets board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || ||
|-
| 2 || ||
|-
| 3 || ||
|-
| 4 || ||
|-
| 5 || ||
|-
| 6 || ||
|-
| 7 || ||
|-
| 8 || ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
57cb5e25ea7cdee1598d94854afcd5be9f3c79ef
Default addresses
0
484
890
2012-03-12T13:55:38Z
Tom
4
Created page with "SPI_LCD 0x82 SPI_DIO 0x84 SPI_SERVO 0x86 SPI_7FETs 0x88 SPI_3FETs 0x8A"
wikitext
text/x-wiki
SPI_LCD 0x82
SPI_DIO 0x84
SPI_SERVO 0x86
SPI_7FETs 0x88
SPI_3FETs 0x8A
7cb1c30d192a3e07e349daf4b395d7722b0b4ad1
Default addresses
0
484
891
890
2012-03-12T13:55:48Z
Tom
4
wikitext
text/x-wiki
SPI_LCD 0x82<br>
SPI_DIO 0x84<br>
SPI_SERVO 0x86<br>
SPI_7FETs 0x88<br>
SPI_3FETs 0x8A<br>
3e2ca8a64fb07e1e25df864f41be755760151254
892
891
2012-03-12T13:58:30Z
Tom
4
wikitext
text/x-wiki
SPI_LCD 0x82<br>
SPI_DIO 0x84<br>
SPI_SERVO 0x86<br>
SPI_7FETs 0x88<br>
SPI_3FETs 0x8A<br>
SPI_TEMO 0x8C<br>
SPI_RELAY 0x8E<br>
03a08c567479b6a675d3e110766f1ae7aa3eb1d3
1035
892
2012-03-23T11:14:19Z
Rew
3
wikitext
text/x-wiki
SPI_LCD 0x82<br>
SPI_DIO 0x84<br>
SPI_SERVO 0x86<br>
SPI_7FETs 0x88<br>
SPI_3FETs 0x8A<br>
SPI_TEMP 0x8C (sometimes called SPI_LM35)<br>
SPI_RELAY 0x8E<br>
6f1a517b0c9d867e35ef3336ea306f1951616ae6
Raspberry Pi Serial
0
59
924
314
2012-03-14T09:13:15Z
Rew
3
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
34d3627d8568496808cc16a83517e1e82c5ef88f
971
924
2012-03-15T14:26:01Z
Rew
3
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
c1c3de2273451d154d702a675c2b5b196764e017
Raspberry pi expansion system page
0
86
929
485
2012-03-14T11:34:30Z
Rew
3
/* intro */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
For some things like standard RS232 serial ports or webcams, you can get cheap USB devices. But to drive a small 16x2 character LCD, or to switch mains-power rpi_serial is for you.
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
The following expansion boards have been designed:
* [[SPI_LCD]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
These expansion boards have two SPI connectors. The first SPI connector is for data transfer during normal operation. The other can be used to daisy-chain the SPI bus to other SPI expansion boards. Or it can be configured to be used as the programming port for the onboard AVR chip.
It should be possible to use one of the raspberry pi SPI buses for data-transfer, while you use the other one to program the AVR chip on the expansion board.
aa8c6c26d76d2670778359a8475a43e4e86c6a8a
3FETs
0
483
1012
888
2012-03-19T12:49:04Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
This is the documentation page for the SPI_3FETs board.
== Overview ==
The board has 3 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 5A per output should be possible. Maximum voltage is 30V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3fets board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
e5adeb34d48868158b12bf6513a244b38049ef71
Relay
0
53
1013
304
2012-03-19T13:42:04Z
Tom
4
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_relay board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
=== LEDs ===
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5a509c1efcec7ba5b762de80b7086408214174e2
1032
1013
2012-03-22T16:15:32Z
Tom
4
/* Related projects */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_relay board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[http://www.bitwizard.nl/wiki/index.php/Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
=== LEDs ===
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
9f788231f7b325d1b272a5aeb188ecf3d051d81f
1038
1032
2012-03-23T11:17:17Z
Tom
4
/* Related projects */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_relay board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
=== LEDs ===
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
3ba4f1bcaaa71c5bbb9985ae9c4b420f7dd42da8
FTDI ATmega
0
6
1014
856
2012-03-21T12:00:28Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
8d9cc771a03c7567ebc04e46a1af2199b0dc3ac3
1031
1014
2012-03-22T16:15:18Z
Tom
4
/* Related projects */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
* [[http://www.bitwizard.nl/wiki/index.php/Temperature_control]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
31bca217d808b083b3d08e3e6322365434afc1a8
1036
1031
2012-03-23T11:16:24Z
Tom
4
/* Related projects */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
88f6a768f0cf35bc52a471f73b1c56be81513368
Main Page
0
1
1015
889
2012-03-22T15:18:31Z
Rew
3
/* Sample programs */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
* [[Default addresses]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
c60b890550fb002dbcb46d33f7b49caa4f1a01c9
1042
1015
2012-03-27T13:42:50Z
Rew
3
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
* [[Default addresses]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
786c8931237321089cb581a0a9ffc1a7c6349d61
1043
1042
2012-03-27T16:09:54Z
Rew
3
/* Miscellaneous */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
* [[Default addresses]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
a8c0e9d9c2f337ca0a68a2d4cb3e4111815cb3d5
1058
1043
2012-04-06T13:42:09Z
Rew
3
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]] [[I2C_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
* [[Default addresses]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
d9ded0082446ba8f3c3f9101415e08db69421b16
Temperature control
0
601
1016
2012-03-22T15:20:25Z
Rew
3
Created page with "= intro = I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup short..."
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
8b3e3e58530607c326b04100278c8895ee0dcc1a
1024
1016
2012-03-22T15:59:51Z
Rew
3
/* Putting the hardware together */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|left|FTDI ATMEGA PCB]]
* and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|left|spi_temp board]]
The spi cable was then daisychained to the next board:
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|left|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|left|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|left|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code> if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
0b806edc537585737f184caff196bd6daccbd19e
1025
1024
2012-03-22T16:00:17Z
Rew
3
/* writing the software */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|left|FTDI ATMEGA PCB]]
* and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|left|spi_temp board]]
The spi cable was then daisychained to the next board:
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|left|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|left|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|left|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
3a4e2ad4102efe05a35aba95ee47b81d15ad0ec8
1026
1025
2012-03-22T16:00:41Z
Rew
3
/* writing the software */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|left|FTDI ATMEGA PCB]]
* and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|left|spi_temp board]]
The spi cable was then daisychained to the next board:
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|left|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|left|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|left|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
b9a2e408b48ea7541fa69fa11b882c3d79965ad5
1027
1026
2012-03-22T16:02:03Z
Rew
3
/* Putting the hardware together */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
== atmega ==
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|left|FTDI ATMEGA PCB]]
== spi_temp ==
and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|left|spi_temp board]]
== spi_relay ==
The spi cable was then daisychained to the next board:
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|left|spi_relay board]]
== extension cord ==
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|left|spi_relay and the extension cord]]
== coffee pot ==
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|left|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
b4601f312bc57452c8bbcfaa8ac0c522b67c6b2a
1028
1027
2012-03-22T16:05:46Z
Rew
3
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|none|FTDI ATMEGA PCB]]
and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|none|spi_temp board]]
The spi cable was then daisychained to the next board:
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|none|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|none|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|none|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
cf31d13f8202bfcaed27b9a9e47b62111121f324
1029
1028
2012-03-22T16:06:08Z
Rew
3
/* Putting the hardware together */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|none|FTDI ATMEGA PCB]]
and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|none|spi_temp board]]
The spi cable was then daisychained to the next board: spi_relay
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|none|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|none|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|none|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
889028cd143d748c9f7d04a0c699871457d426d2
1030
1029
2012-03-22T16:14:26Z
Tom
4
/* writing the software */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|none|FTDI ATMEGA PCB]]
and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|none|spi_temp board]]
The spi cable was then daisychained to the next board: spi_relay
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|none|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|none|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|none|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
18f6eba5dc051163d24f8d6b7181c694d8ec4251
1034
1030
2012-03-23T10:48:12Z
Rew
3
/* writing the software */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|none|FTDI ATMEGA PCB]]
and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|none|spi_temp board]]
The spi cable was then daisychained to the next board: spi_relay
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|none|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|none|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|none|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
bf58039d514a8a648fcf7c8badd2571169e3c289
File:Tempcontroller 01 ftdi atmega.jpg
6
603
1018
2012-03-22T15:40:23Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Tempcontroller 02 spi temp.jpg
6
604
1019
2012-03-22T15:40:38Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Tempcontroller 03 spi relay.jpg
6
605
1020
2012-03-22T15:40:53Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Tempcontroller 04 relay and extensioncord.jpg
6
606
1021
2012-03-22T15:41:08Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
1039
1021
2012-03-23T11:19:03Z
Rew
3
uploaded a new version of "[[File:Tempcontroller 04 relay and extensioncord.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Tempcontroller 05 coffee pot.jpg
6
607
1022
2012-03-22T15:42:00Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Tempcontroller 06 sensor.jpg
6
608
1023
2012-03-22T15:42:17Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Temperature Interface
0
51
1033
725
2012-03-22T16:15:40Z
Tom
4
/* Related projects */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[http://www.bitwizard.nl/wiki/index.php/Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
fcc38d5a10e3823165516c07e37d3a03ee53d6d6
1037
1033
2012-03-23T11:16:53Z
Tom
4
/* Related projects */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
84fea4660fc499c202aa1206f8831f711d7e1127
Iphone 3GS camera
0
611
1044
2012-03-27T16:22:04Z
Rew
3
Created page with "== intro == I bought an Iphone 3GS camera module as it is cheap, and I expected to be able to interface it with something, probably an FPGA. == pinout == Getting the pinou..."
wikitext
text/x-wiki
== intro ==
I bought an Iphone 3GS camera module as it is cheap, and I expected to be able to interface it with something, probably an FPGA.
== pinout ==
Getting the pinout is not easy.
The connector has a central part with 12 pins on each side and a further 4 pins on the corners. Those four pins on the corners are numbered 25 through 28. The other pins are numbered 1,3,5,...-23 on one side and 2,4,6,...-24 on the other side.
So far I've managed to find:
<table border=1>
<tr><td>1,2,7,8,10</td><td>GND</td></tr>
<tr><td>3,4,5,6</td><td>NC</td></tr>
<tr><td>9,11</td><td>DATAP0, DATAN0</td></tr>
<tr><td>13,16,17</td><td>GND</td></tr>
<tr><td>12</td><td>VCC 3.0V</td></tr>
<tr><td>15</td><td>VCC 1.8V ?</td></tr>
<tr><td>18</td><td>CLK</td></tr>
<tr><td>19,21</td><td>PCLKP, PCLKN</td></tr>
<tr><td>20</td><td>SCL</td></tr>
<tr><td>22</td><td>SDA</td></tr>
<tr><td>23,24</td><td>GND</td></tr>
<tr><td>25,26,27,28</td><td>GND</td></tr>
</table>
This makes me think: The pixel data is transferred serially. Configuration data is transferred using I2C.
58649abf9358a9c4c8ab5a93a4eeaaebd4e14967
1045
1044
2012-03-27T16:22:52Z
Rew
3
/* pinout */
wikitext
text/x-wiki
== intro ==
I bought an Iphone 3GS camera module as it is cheap, and I expected to be able to interface it with something, probably an FPGA.
== pinout ==
Getting the pinout is not easy.
The connector has a central part with 12 pins on each side and a further 4 pins on the corners. Those four pins on the corners are numbered 25 through 28. The other pins are numbered 1,3,5,...-23 on one side and 2,4,6,...-24 on the other side.
So far I've managed to find:
<table border=1>
<tr><td>1,2,7,8,10</td><td>GND</td></tr>
<tr><td>3,4,5,6</td><td>NC</td></tr>
<tr><td>9,11</td><td>DATAP0, DATAN0</td></tr>
<tr><td>13,16,17</td><td>GND</td></tr>
<tr><td>12</td><td>VCC 3.0V</td></tr>
<tr><td>14</td><td>RESETN</td></tr>
<tr><td>15</td><td>VCC 1.8V ?</td></tr>
<tr><td>18</td><td>CLK</td></tr>
<tr><td>19,21</td><td>PCLKP, PCLKN</td></tr>
<tr><td>20</td><td>SCL</td></tr>
<tr><td>22</td><td>SDA</td></tr>
<tr><td>23,24</td><td>GND</td></tr>
<tr><td>25,26,27,28</td><td>GND</td></tr>
</table>
This makes me think: The pixel data is transferred serially. Configuration data is transferred using I2C.
571c95baefa11616ac94005a7bfc7f12f07816ca
DIO
0
52
1046
303
2012-03-28T11:15:24Z
Tom
4
/* Programming */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_DIO board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].<br>
The board specific protocol can be found here: [[spi_dio_protocol]]<br>
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
abd8cb76c6c67b5e626271187997ab0eaaa551ae
1047
1046
2012-03-28T11:16:19Z
Tom
4
/* Jumper settings */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_DIO board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].<br>
The board specific protocol can be found here: [[spi_dio_protocol]]<br>
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
d6dcf983a0ba7bd3f298e1f60e2e1d5820a8e9df
1048
1047
2012-03-28T11:17:03Z
Tom
4
/* Assembly instructions */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_DIO board.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].<br>
The board specific protocol can be found here: [[spi_dio_protocol]]<br>
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
15ac0473e947f8e1887c43afac2926974c1d9172
RGB clock
0
25
1052
886
2012-04-02T08:09:42Z
Tom
4
/* Over USB */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff fx ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x| | | | | | | LED 0
x | | | | | | | LED 1
| x| | | | | | LED 2
|x | | | | | | LED 3
| | x| | | | | LED 4
| |x | | | | | LED 5
| | | x| | | | LED 6
| | |x | | | | LED 7
| | | |x | | | LED 8
| | | | | x| | LED 9
| | | | |x | | LED 10
| | | | | | x| LED 11
| | | | | |x | LED 12
| | | | | | | x LED 13
| | | | | | |x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 40 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
df9caaca9fe6c0268060ca28288ec296960c2895
DIO protocol
0
432
1053
814
2012-04-04T18:41:32Z
Rew
3
/* turn on output 4 */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x40 || set/read current position.
|-
| 0x41 || set/read target position.
|-
| 0x42 || set/read relative position.
|-
| 0x43 || set/read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x10 || xx || port 0x10 all outputs in bitpattern.
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
Turn on output 4.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
69de870df609f18ad2cacd343552e53ba8543da1
I2C LCD
0
618
1059
2012-04-06T13:52:17Z
Rew
3
Created page with "[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]] This is the documentation page for the I2C_LCD board. == Overview == == Assembly instructions == ..."
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the I2C_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for SPI operation.
The second SPI port can be used as an ICSP connector by changing a solder-jumper.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The board has two SPI connectors that are not populated and should not be used in the I2C version. [[SPI connector pinout]]
The board has two I2C connectors. [[I2C connector pinout]]
=== LEDs ===
none.
(A future version will have a powerled).
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the non-default configuration, the second SPI connector is the ICSP connector.<br>
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration. <br>
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This could be used in the the I2C configuration, but to keep the software simpler this is not done. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the I2C bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
''An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] . This appplication was written for the ftdi_atmega board from bitwizard, but can also be used on an arduino. But you'll have to download the hex to your board by hand after compiling.
''
For arduino, a sample PDE is available, called ar_i2c_lcd_demo.pde, also at [[http://www.bitwizard.nl/software the bitwizard software download directory]] .
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
8857d2884bfd4d02d5c9ba29c42fd96cdc4ff2e8
1065
1059
2012-04-06T14:02:00Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the I2C_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for SPI operation.
The second SPI port can be used as an ICSP connector by changing a solder-jumper.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The board has two SPI connectors that are not populated and should not be used in the I2C version. [[SPI connector pinout]]
The board has two I2C connectors. [[I2C connector pinout]]
=== LEDs ===
none.
(A future version will have a powerled).
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the non-default configuration, the second SPI connector is the ICSP connector.<br>
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration. <br>
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This could be used in the the I2C configuration, but to keep the software simpler this is not done. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the I2C bus to the PCB. The [[i2c_lcd_protocol|protocol is explained here]].
''An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] . This appplication was written for the ftdi_atmega board from bitwizard, but can also be used on an arduino. But you'll have to download the hex to your board by hand after compiling.
''
For arduino, a sample PDE is available, called ar_i2c_lcd_demo.pde, also at [[http://www.bitwizard.nl/software the bitwizard software download directory]] .
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
bf7ec187b668ca8809476e5ba496f0b5903b55ba
SPI LCD
0
48
1060
726
2012-04-06T13:52:27Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD board by changing a solder-jumper.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for I2C operation.
The second SPI port can be used as an ICSP connector.
== External resources ==
=== Datasheets ===
The fets:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The SPI_LCD board has two SPI connectors. [[SPI connector pinout]]
=== LEDs ===
none.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration. <br>
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the SPI bus to the PCB. The [[spi_lcd 1.3_protocol|protocol is explained here]]. If you have an older version, 1.2, [[spi_lcd_1.2_protocol|the protocol is explained here]]
An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] . This appplication was written for the ftdi_atmega board from bitwizard, but can also be used on an arduino. But you'll have to download the hex to your board by hand after compiling.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [[http://www.bitwizard.nl/software the bitwizard software download directory]] .
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
48378690e9010df70da29d44d6f5110d3ea0fc20
I2C connector pinout
0
619
1061
2012-04-06T13:56:40Z
Rew
3
Created page with " For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable. {| border=1 ! pin !! function !! remark |- | 1 || GND || Power Grou..."
wikitext
text/x-wiki
For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable.
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || SDA || Serial I2C Data
|-
| 3 || SCK || Serial I2C Clock
|-
| 4 || VCC || Power 5V.
|-
|}
The connector is laid out as follows:
== Connecting the bitwizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin
|-
| 1 || GND || GND
|-
| 2 || SDA || A4 (Analog input 4)
|-
| 3 || SCK || A5 (analog input 5)
|-
| 4 || VCC || VCC
|-
|}
You could use other pins, but then you have to make a software I2C implementation. This is not too difficult, but might be neccesary if something else is already on the I2C pins.
2d0e8d85b99415921de7255e3d116f2b0fa41046
1062
1061
2012-04-06T13:57:29Z
Rew
3
/* Connecting the bitwizard boards to an Arduino */
wikitext
text/x-wiki
For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable.
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || SDA || Serial I2C Data
|-
| 3 || SCK || Serial I2C Clock
|-
| 4 || VCC || Power 5V.
|-
|}
The connector is laid out as follows:
== Connecting the bitwizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || SDA || A4 (Analog input 4) || Digital 20
|-
| 3 || SCK || A5 (analog input 5) || Digital 21
|-
| 4 || VCC || VCC || VCC
|-
|}
You could use other pins, but then you have to make a software I2C implementation. This is not too difficult, but might be neccesary if something else is already on the I2C pins.
f0364c733c5df4ff902840a52f5bc8a2656fe166
1063
1062
2012-04-06T13:57:49Z
Rew
3
/* Connecting the bitwizard boards to an Arduino */
wikitext
text/x-wiki
For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable.
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || SDA || Serial I2C Data
|-
| 3 || SCK || Serial I2C Clock
|-
| 4 || VCC || Power 5V.
|-
|}
The connector is laid out as follows:
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || SDA || A4 (Analog input 4) || Digital 20
|-
| 3 || SCK || A5 (analog input 5) || Digital 21
|-
| 4 || VCC || VCC || VCC
|-
|}
You could use other pins, but then you have to make a software I2C implementation. This is not too difficult, but might be neccesary if something else is already on the I2C pins.
612ebde072bcc5d807aec6c461c7887a95b63d63
SPI connector pinout
0
87
1064
677
2012-04-06T13:57:58Z
Rew
3
wikitext
text/x-wiki
For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable.
The pinout is the same (or very similar) to the pinout of the 6-pin ICSP programming connector that lots of AVR boards have.
{| border=1
! pin !! function !! remark
|-
| 1 || MISO || Master In Slave Out
|-
| 2 || VCC || power
|-
| 3 || SCK || Shift Clock
|-
| 4 || MOSI || Master Out Slave In.
|-
| 5 || SS || Slave Select
|-
| 6 || GND || Ground 0V
|-
|}
The connector is laid out as follows:
{| border=1
|-
| 1 || 2
|-
| 3 || 4
|-
| 5 || 6
|-
|}
The board usually has pin 1 and six marked.
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin
|-
| 1 || MISO || 12
|-
| 2 || VCC || 5V
|-
| 3 || SCK || 13
|-
| 4 || MOSI || 11
|-
| 5 || SS || 10
|-
| 6 || GND || Gnd
|-
|}
You could use other pins, but then you have to make a software SPI implementation. This is not too difficult, but might be neccesary if something else is already on the SPI pins. On the other hand, you might be able to still use the hardware SPI module by just moving the "SS" pin somewhere else.
03b856bf2bb5bb0fa0356651b31d8e65d43a6be3
I2c lcd protocol
0
620
1066
2012-04-06T14:08:29Z
Rew
3
Created page with " The addresses on the I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read t..."
wikitext
text/x-wiki
The addresses on the I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the I2C bus starts with the address of the board. The i2c_lcd board will ignore any transactions on the I2C bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general I2C protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The i2c_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('i2c_lcd 1.4').
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE.
|-
| 0x01 || identify port
|-
| STOP || create a STOP condition on the bus.
|-|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for READ
|-
| 0x69 || 'i'
|-
| 0x32 || '2'
|-
| 0x63 || 'c'
|-
| ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent || explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x00 || datastream
|-
| 0x48 || 'H'
|-
| 0x65 || 'e'
|-
| 0x6c || 'l'
|-
| 0x6c || 'l'
|-
| 0x6f || 'o'
|-
| xx || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
a699f162e55d9cb1fcdb4d82c1562e549ed7a76a
I2C LCD
0
618
1067
1065
2012-04-06T14:10:39Z
Tom
4
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the I2C_LCD board.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The board can also be configured for SPI operation.
The second SPI port can be used as an ICSP connector by changing a solder-jumper.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The board has two SPI connectors that are not populated and should not be used in the I2C version. [[SPI connector pinout]]
The board has two I2C connectors. [[I2C connector pinout]]
=== LEDs ===
none.
(A future version will have a powerled).
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the non-default configuration, the second SPI connector is the ICSP connector.<br>
The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration. <br>
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This could be used in the the I2C configuration, but to keep the software simpler this is not done. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
To display things on the LCD, you need to send things over the I2C bus to the PCB. The [[i2c_lcd_protocol|protocol is explained here]].
''An example application is called "demo_lcd" and is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]] . This appplication was written for the ftdi_atmega board from bitwizard, but can also be used on an arduino. But you'll have to download the hex to your board by hand after compiling.
''
For arduino, a sample PDE is available, called ar_i2c_lcd_demo.pde, also at [[http://www.bitwizard.nl/software the bitwizard software download directory]] .
== The software ==
== Future hardware enhancements ==
* Add a power LED
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
* Allow setting of the current eeprom address.
* Allow reading/writing of the eeprom.
== Changelog ==
=== 1.2 ===
* Initial public release
744b6a69bae55c6fc0a7846424926036b5270a37
I2c lcd protocol
0
620
1068
1066
2012-04-06T14:11:32Z
Rew
3
/* set cursor position */
wikitext
text/x-wiki
The addresses on the I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the I2C bus starts with the address of the board. The i2c_lcd board will ignore any transactions on the I2C bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general I2C protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The i2c_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('i2c_lcd 1.4').
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE.
|-
| 0x01 || identify port
|-
| STOP || create a STOP condition on the bus.
|-|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for READ
|-
| 0x69 || 'i'
|-
| 0x32 || '2'
|-
| 0x63 || 'c'
|-
| ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent || explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x00 || datastream
|-
| 0x48 || 'H'
|-
| 0x65 || 'e'
|-
| 0x6c || 'l'
|-
| 0x6c || 'l'
|-
| 0x6f || 'o'
|-
| xx || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x11 || port 0x11 = set cursor position.
|-
| 0x25 || 0x25 = 001 00101 = line 1 position 5.
|-
| STOP || create a STOP condition on the bus.
|-
|}
e28b206d4626eea56262e7b7b2577c128ebb116f
1069
1068
2012-04-06T14:11:44Z
Rew
3
/* set cursor position */
wikitext
text/x-wiki
The addresses on the I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the I2C bus starts with the address of the board. The i2c_lcd board will ignore any transactions on the I2C bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general I2C protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The i2c_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('i2c_lcd 1.4').
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE.
|-
| 0x01 || identify port
|-
| STOP || create a STOP condition on the bus.
|-|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for READ
|-
| 0x69 || 'i'
|-
| 0x32 || '2'
|-
| 0x63 || 'c'
|-
| ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent || explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x00 || datastream
|-
| 0x48 || 'H'
|-
| 0x65 || 'e'
|-
| 0x6c || 'l'
|-
| 0x6c || 'l'
|-
| 0x6f || 'o'
|-
| xx || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x11 || port 0x11 = set cursor position.
|-
| 0x25 || 0x25 = 001 00101 = line 1 position 5.
|-
| STOP || create a STOP condition on the bus.
|-
|}
3527695ecfc2ae7ea8c3e6466c24f2d7fbfa5b41
1070
1069
2012-04-06T14:14:18Z
Rew
3
/* read identification */
wikitext
text/x-wiki
The addresses on the I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the I2C bus starts with the address of the board. The i2c_lcd board will ignore any transactions on the I2C bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general I2C protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The i2c_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('i2c_lcd 1.4').
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE.
|-
| 0x01 || identify port
|-
| STOP || create a STOP condition on the bus.
|-|-
| START || create a START condition on the bus.
|-
| 0x83 || select destination with address 0x82 for READ
|-
| 0x69 || 'i'
|-
| 0x32 || '2'
|-
| 0x63 || 'c'
|-
| ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent || explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x00 || datastream
|-
| 0x48 || 'H'
|-
| 0x65 || 'e'
|-
| 0x6c || 'l'
|-
| 0x6c || 'l'
|-
| 0x6f || 'o'
|-
| xx || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x11 || port 0x11 = set cursor position.
|-
| 0x25 || 0x25 = 001 00101 = line 1 position 5.
|-
| STOP || create a STOP condition on the bus.
|-
|}
c60e5da958f713dc57bc1317fa11a23545a5cd32
General I2C protocol
0
621
1071
2012-04-06T14:22:11Z
Rew
3
Created page with " BitWizard expansion boards communicate using an I2C protocol. I2C is a standard protocol, sometimes called "TW" or "TWI" by other manufacturers. Each I2C slave has its own..."
wikitext
text/x-wiki
BitWizard expansion boards communicate using an I2C protocol.
I2C is a standard protocol, sometimes called "TW" or "TWI" by other manufacturers.
Each I2C slave has its own I2C address. This allows us to daisy chain a large number of boards. The BitWizard I2C boards can be told to use a different I2C address so that you can resolve conflicts if you would otherwise have several devices at one address.
= timing =
The slaves use an ATTINY44 processor. These have a hardware universal serial interface (USI) module that can be configured as "I2C slave". Many things however have to be processed in software. This means that some time is required between each byte. The hardware of the ATTINY44 will pull the SCL line low while the processing is not finished. If you use a software I2C master, doublecheck that your I2C master supports this feature.
The I2C protocol is specified at 100kHz and 400kHz bit rate. If you lower the pullup resistors a bit and have a short bus, the hardware will probably be able to handle bit rates up to 2MHz. This is not recommended. Use the standard 400kHz.
= protocol =
To send a sequence of bytes to the slave I2C device, the master starts by creating a START condition: the SDA line goes low while SCL is held high. All slaves are now primed to receive an "address" byte. Next the master sends the address byte.
After this the protocol in theory depends on which slave you are talking to. In practice so far it is convenient to make the slaves talk a similar protocol: the next byte specifies a "register" or "port" address. After this you can send data to that port or register.
If the data can be considered a "data stream" like with the I2C_LCD board, you can call it a "port". If there is just a single value, it is more common to call it a register.
17f47d212e005cd35bf54ca1c3870494247d74e5
RGB clock
0
25
1072
1052
2012-04-16T14:49:36Z
Tom
4
/* Complete RGB bitmap */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f5cfd2baf5718d538fc563249f8503518ed16fdb
1073
1072
2012-04-16T14:55:36Z
Tomtest
489
wikitext
text/x-wiki
testedit
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5037d9af9043ba3ec4bd36001ed016bb200dc6a4
1074
1073
2012-04-16T14:55:54Z
Tom
4
Reverted edits by [[Special:Contributions/Tomtest|Tomtest]] ([[User talk:Tomtest|talk]]) to last revision by [[User:Tom|Tom]]
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f5cfd2baf5718d538fc563249f8503518ed16fdb
Default addresses
0
484
1079
1035
2012-04-18T15:27:59Z
Tom
4
wikitext
text/x-wiki
SPI_LCD 0x82<br>
SPI_DIO 0x84<br>
SPI_SERVO 0x86<br>
SPI_7FETs 0x88<br>
SPI_3FETs 0x8A<br>
SPI_TEMP 0x8C (sometimes called SPI_LM35)<br>
SPI_RELAY 0x8E<br>
SPI_motor 0x90<br>
055a369c0b89afd6a9fe17a7762c18425dafa56a
Main Page
0
1
1080
1058
2012-04-18T16:08:56Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]] [[I2C_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
* [[Default addresses]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
82445e4c78795f2b2c39f093d4aad5fa2fc695a1
1105
1080
2012-04-25T14:56:52Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[SPI_LCD]]
* [[I2C_LCD]]
* [[SPI_3FETs]]
* [[SPI_7FETs]]
* [[SPI_Servo]]
* [[SPI_LM35]]
* [[SPI_DIO]]
* [[SPI_relay]]
* [[16 LEDs]]
* [[Default addresses]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
e9d95724ccb4c910caa5086a126c2b3c8dc2b0b9
1130
1105
2012-05-04T16:03:49Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
== SPI ==
* [[SPI_LCD]]
* [[SPI_DIO]]
* [[SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[I2C_DIO]]
* [[I2C_Servo]]
* [[I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
b3fbbec685d06d53bf544e6ab032dac5171360da
1155
1130
2012-05-11T14:19:16Z
Rew
3
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[SPI_DIO]]
* [[SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[I2C_DIO]]
* [[I2C_Servo]]
* [[I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
5ced17dac0267ceb1cf6812abd2bef04a18bc961
1172
1155
2012-05-11T15:10:18Z
Rew
3
/* SPI */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[I2C_DIO]]
* [[I2C_Servo]]
* [[I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
199fd1a6520116f2a083e7383bfc96149499acf2
FTDI serial 2
0
625
1081
2012-04-18T16:12:08Z
Tom
4
Created page with "This is the documentation page for the FTDI-serial 2 board. == overview == The FTDI-serial 2 board has an USB connector and a 4-pin serial/UART connector. The brains of the..."
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial 2 board.
== overview ==
The FTDI-serial 2 board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
<tr><td>3</td><td>VCC (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (place jumper near FTDI)<br>
2-3: 5V (place jumper near UART header)<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
c8b210c247e7edd0cba88f78c3900f1bec344b35
1082
1081
2012-04-18T16:12:21Z
Tom
4
/* pinout */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial 2 board.
== overview ==
The FTDI-serial 2 board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
<tr><td>4</td><td>VCC (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (place jumper near FTDI)<br>
2-3: 5V (place jumper near UART header)<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
c266f6abe86c7498b35486089c7956d457b9871a
DIO protocol
0
432
1126
1053
2012-05-04T15:25:35Z
Tom
4
/* read identification */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x40 || set/read current position.
|-
| 0x41 || set/read target position.
|-
| 0x42 || set/read relative position.
|-
| 0x43 || set/read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x10 || xx || port 0x10 all outputs in bitpattern.
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
Turn on output 4.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x82 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
fbe3a62e6bcc9d58c117fd3197ee1e64e8f5332e
1127
1126
2012-05-04T15:49:53Z
Tom
4
wikitext
text/x-wiki
= Introduction =
The protocol for the SPI_dio, SPI_3FETs and SPI_7FETs will be explained on this page. Most functions apply to all three boards, but some don't.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio, spi_3fets and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only spi_dio and spi_7fets)
|-
| 0x41 || set target position. (only spi_dio and spi_7fets)
|-
| 0x42 || set relative position. (only spi_dio and spi_7fets)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_dio, spi_3fets and spi_7fets boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only spi_dio and spi_7fets)
|-
| 0x41 || read target position. (only spi_dio and spi_7fets)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|}
= examples =
== read identification ==
read the identification string of the board. (spi_dio)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x85 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
2fca2aeeef629cfef74281a0da89def51b9148c5
1128
1127
2012-05-04T15:53:39Z
Tom
4
wikitext
text/x-wiki
= Introduction =
The protocol for the SPI_dio, SPI_3FETs and SPI_7FETs will be explained on this page. Most functions apply to all three boards, but some don't.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio, spi_3fets and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only spi_dio and spi_7fets)
|-
| 0x41 || set target position. (only spi_dio and spi_7fets)
|-
| 0x42 || set relative position. (only spi_dio and spi_7fets)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_dio, spi_3fets and spi_7fets boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only spi_dio and spi_7fets)
|-
| 0x41 || read target position. (only spi_dio and spi_7fets)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|}
= examples =
== read identification ==
read the identification string of the board. (spi_dio)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x85 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
5a00694f4d85d7aafe8fc4a79fefcd406d84789f
1157
1128
2012-05-11T14:32:08Z
Rew
3
moved [[Spi dio protocol]] to [[DIO protocol]]: removed mention of SPI.
wikitext
text/x-wiki
= Introduction =
The protocol for the SPI_dio, SPI_3FETs and SPI_7FETs will be explained on this page. Most functions apply to all three boards, but some don't.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio, spi_3fets and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only spi_dio and spi_7fets)
|-
| 0x41 || set target position. (only spi_dio and spi_7fets)
|-
| 0x42 || set relative position. (only spi_dio and spi_7fets)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_dio, spi_3fets and spi_7fets boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only spi_dio and spi_7fets)
|-
| 0x41 || read target position. (only spi_dio and spi_7fets)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|}
= examples =
== read identification ==
read the identification string of the board. (spi_dio)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x85 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
5a00694f4d85d7aafe8fc4a79fefcd406d84789f
1160
1157
2012-05-11T14:36:02Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_dio, spi_3fets and spi_7fets boards define several ports.
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only spi_dio and spi_7fets)
|-
| 0x41 || set target position. (only spi_dio and spi_7fets)
|-
| 0x42 || set relative position. (only spi_dio and spi_7fets)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_dio, spi_3fets and spi_7fets boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only spi_dio and spi_7fets)
|-
| 0x41 || read target position. (only spi_dio and spi_7fets)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|}
= examples =
== read identification ==
read the identification string of the board. (spi_dio)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x85 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
335edefa9e3e65ee5b20ceb76fe4ddfcca3f5634
1161
1160
2012-05-11T14:39:07Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The spi_dio, spi_3fets and spi_7fets boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only spi_dio and spi_7fets)
|-
| 0x41 || read target position. (only spi_dio and spi_7fets)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only spi_dio and spi_7fets)
|}
= examples =
== read identification ==
read the identification string of the board. (spi_dio)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x85 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
484fd640b3853d5ac8df93117dc46318ec7dc520
1162
1161
2012-05-11T14:40:04Z
Rew
3
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|}
= examples =
== read identification ==
read the identification string of the board. (spi_dio)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x85 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
bce593eb2518a6f3ad04f8417231f0fcd1f2c27c
1163
1162
2012-05-11T14:40:29Z
Rew
3
/* read identification */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|}
= examples =
== read identification ==
read the identification string of the board. (spi_dio)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
1ebe2e168db79237cced6f5a5ec3dbb9dc536580
1164
1163
2012-05-11T14:59:53Z
Rew
3
/* examples */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
91373dc041bbb0490bbf0bdd9d3f4f44c0247cf5
Motor protocol
0
657
1129
2012-05-04T15:59:21Z
Tom
4
Created page with "'''--- UNDER CONSTRUCTION!!! ---''' More info will be added. = Introduction = The protocol for the SPI_motor board will be explained on this page. The addresses on the SPI ..."
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 ||
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position.
|-
| 0x41 || set target position.
|-
| 0x42 || set relative position.
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
e811b79f3eb3fcc31ef5fdd4e0e0a0a089dcfa4c
1134
1129
2012-05-07T11:27:15Z
Tom
4
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position.
|-
| 0x41 || set target position.
|-
| 0x42 || set relative position.
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
2aff951ba0b0b9ff64120d61b453953e453556a6
1136
1134
2012-05-07T13:17:59Z
Tom
4
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position.
|-
| 0x41 || set target position.
|-
| 0x42 || set relative position.
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
6d7402b7b801fbb55b59f33fbf972823892db442
Motor
0
658
1131
2012-05-04T16:09:04Z
Tom
4
Created page with "[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]] This is the documentation page for the SPI_motor board. == Overview == == Assembly instruction..."
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function
|-
| 1 ||
|-
| 2 ||
|-
| 3 ||
|-
| 4 ||
|-
| 5 ||
|-
| 6 ||
|}
=== Jumper ===
=== LEDs ===
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
To make the motor PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the motor PCB are explained in [[Spi_motor_protocol]].
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the motor board as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
4da36be8e9f85c11886b0514bc28857424b4b4d7
1132
1131
2012-05-07T11:24:26Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
=== LEDs ===
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
To make the motor PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the motor PCB are explained in [[Spi_motor_protocol]].
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the motor board as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
60def16fb42e3103bfd4842d4bd4638720bfba61
1133
1132
2012-05-07T11:24:40Z
Tom
4
/* LEDs */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
To make the motor PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the motor PCB are explained in [[Spi_motor_protocol]].
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the motor board as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
c4624aed0a063519965ce8157564608e3436ed0e
1143
1133
2012-05-10T10:10:22Z
Tom
4
/* Overview */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
To make the motor PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the motor PCB are explained in [[Spi_motor_protocol]].
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the motor board as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
47b3b273b283c2d5071928f15cae854a217b87de
I2C connector pinout
0
619
1135
1063
2012-05-07T13:16:14Z
Tom
4
wikitext
text/x-wiki
For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable.
The connector is laid out as follows:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || SDA || Serial I2C Data
|-
| 3 || SCK || Serial I2C Clock
|-
| 4 || VCC || Power 5V.
|-
|}
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || SDA || A4 (Analog input 4) || Digital 20
|-
| 3 || SCK || A5 (analog input 5) || Digital 21
|-
| 4 || VCC || VCC || VCC
|-
|}
You could use other pins, but then you have to make a software I2C implementation. This is not too difficult, but might be neccesary if something else is already on the I2C pins.
2af0c4baf33b85915bc357cdda535fa05e573b15
DIO
0
52
1144
1048
2012-05-10T10:16:38Z
Tom
4
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].<br>
The board specific protocol can be found here: [[spi_dio_protocol]]<br>
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
20cec4428d93d57b78dc4957448f63cc295c9257
1154
1144
2012-05-11T13:25:56Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].<br>
The board specific protocol can be found here: [[spi_dio_protocol]]<br>
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0b3a9c14f9afda7f860b6a004a732df997a7050c
1165
1154
2012-05-11T15:01:23Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].<br>
The board specific protocol can be found here: [[DIO_protocol]]<br>
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5d9ff4206fccc7f60a1ac0a98fb299cb4f416efe
1166
1165
2012-05-11T15:01:42Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].<br>
The board specific protocol can be found here: [[DIO_protocol]]<br>
You should also read the [[General_SPI_protocol]] notes. <br>
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
3882b400f2a921d8bf081e8654643f6a84feb962
1167
1166
2012-05-11T15:01:55Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
The board specific protocol can be found here: [[DIO_protocol]]<br>
You should also read the [[General_SPI_protocol]] notes. <br>
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
500246181dc534cac555e8b7ed042ba862d33495
1168
1167
2012-05-11T15:02:21Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
180b262bcc5345f17910110868e3e3d6fd6e613b
1169
1168
2012-05-11T15:02:47Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3fets and 7fets boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
e181e16b4f7ec27f07b188fc7ca35703137e9041
1170
1169
2012-05-11T15:03:05Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
18c0b33926122bfb7be9f29084d1393b826e24f5
1171
1170
2012-05-11T15:04:35Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocosl read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
dd70b33b74986e7b26e79f7918d24a5e95669b22
1173
1171
2012-05-11T15:10:55Z
Rew
3
moved [[SPI DIO]] to [[DIO]]: now for both SPI and I2C
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The SPI_DIO board|The SPI_DIO board]]
This is the documentation page for the SPI_DIO board.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocosl read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
dd70b33b74986e7b26e79f7918d24a5e95669b22
1175
1173
2012-05-11T15:11:34Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocosl read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
d54b30be3e09ab4702cd5b46de18a2c0d807d7c8
1176
1175
2012-05-11T15:12:04Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocosl read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
00d544dc5e912ad0bbb7bc27cb4e5f6f30a220e4
File:SPI DIO.jpg
6
672
1153
2012-05-11T13:25:10Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
SPI versus I2C protocols
0
673
1156
2012-05-11T14:31:02Z
Rew
3
Created page with "The bitwizard expansion boards speak the same protocol whether you have the SPI or the I2C version. The I2C protocol is inherently half-duplex. The SPI protocol is inherentl..."
wikitext
text/x-wiki
The bitwizard expansion boards speak the same protocol whether you have the SPI or the I2C version.
The I2C protocol is inherently half-duplex. The SPI protocol is inherently full-duplex.
When designing the SPI protocol we noticed that most of the time we didn't have data to send one direction anyway. When you WANT to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, the slave doesn't really have anything to report back when you are actually sending data to the slave.
So from the software point-of-view both protocols are now half-duplex.
To write data using SPI send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
For I2C: Exactly the same!
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
d1797b4f85eb8979c96e16eae928a94130ae2d0f
1159
1156
2012-05-11T14:35:44Z
Rew
3
wikitext
text/x-wiki
The bitwizard expansion boards speak the same protocol whether you have the SPI or the I2C version.
The I2C protocol is inherently half-duplex. The SPI protocol is inherently full-duplex.
When designing the SPI protocol we noticed that most of the time we didn't have data to send one direction anyway. When you WANT to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, the slave doesn't really have anything to report back when you are actually sending data to the slave.
So from the software point-of-view both protocols are now half-duplex.
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
For I2C: Exactly the same!
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
41228389feef0ee8e6ec62aabe7672448027842f
Spi dio protocol
0
674
1158
2012-05-11T14:32:08Z
Rew
3
moved [[Spi dio protocol]] to [[DIO protocol]]: removed mention of SPI.
wikitext
text/x-wiki
#REDIRECT [[DIO protocol]]
95b72ee0e75dc549ef82d5cbd2656db18168af8d
SPI DIO
0
675
1174
2012-05-11T15:10:55Z
Rew
3
moved [[SPI DIO]] to [[DIO]]: now for both SPI and I2C
wikitext
text/x-wiki
#REDIRECT [[DIO]]
bf37aff6978dac1a171bac9af0b1d5f6a314d23e
Main Page
0
1
1177
1172
2012-05-11T15:12:56Z
Rew
3
/* I2C */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[I2C_Servo]]
* [[I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
2b9245a3aba220194b14df491554e2f09d977a4d
1178
1177
2012-05-11T15:13:14Z
Rew
3
/* SPI */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[I2C_Servo]]
* [[I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
6a9e697dbce93fbc4eb63c9c07b41b640d7b5033
1196
1178
2012-05-11T15:37:28Z
Rew
3
/* I2C */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
0f4a211a55f3896730fcfd590607d773d7ae6d21
1197
1196
2012-05-11T15:37:46Z
Rew
3
/* I2C */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETS|I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
6a3f7e85273f9c15439e582bbd32d1c5a8090804
1198
1197
2012-05-11T15:38:31Z
Rew
3
/* I2C */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
4bbd3db79cffb4412d7fece0a4970eb057dec57f
1199
1198
2012-05-11T15:38:46Z
Rew
3
/* I2C */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[SPI_7FETs]]
* [[SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
bfde70854f6a313d7c144da2c8493f2478b38e2f
1200
1199
2012-05-11T15:39:06Z
Rew
3
/* SPI */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[I2C_LM35]]
* [[I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
7cc3c0491a835bc56b4efd60c1b7c103291dcc57
1216
1200
2012-05-11T16:11:27Z
Rew
3
/* I2C */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[I2C_LM35]]
* [[relay|I2C_relay]]
* [[I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
7329a55baed5087b8963a5345b61f156cf120a2c
1221
1216
2012-05-11T16:13:49Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[I2C_LM35]]
* [[relay|I2C_relay]]
* [[motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
06f3fee5c21a50f0bd90551f61c23001e63e718b
1222
1221
2012-05-11T16:14:22Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[SPI_LM35]]
* [[SPI_relay]]
* [[motor|SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[I2C_LM35]]
* [[relay|I2C_relay]]
* [[motor|I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
28bb2ead7bb81639de5487626948a0798a82a2a9
Servo
0
50
1179
481
2012-05-11T15:13:46Z
Rew
3
moved [[SPI Servo]] to [[Servo]]: now for both SPI and I2C
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The SPI_Servo PCB]]
This is the documentation page for the SPI_servo board.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI connectors, so daisychaining multiple SPI modules is an option.<br>
This allows you to control the LCD with only 4 data lines (MOSI, MISO, SS and SCK). This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing additional boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, etcetera. Other computers/boards with an SPI interface (such as the Raspberry Pi) should also be able to control this module.<br>
<br>
For small servos, the power supplied by the SPI connector is enough. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and cutting the trace connecting the servo power rail to the SPI power rail. Future versions will have a jumper for this cause, and a dedicated servo power connector.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector marked SPI3 (near the edge of the board) is enabled.<br>
== Programming ==
To control the servos, you need to send things over the SPI bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
d586d290248ed4209e374889c54d9919584eb609
1181
1179
2012-05-11T15:20:41Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Programming ==
To control the servos, you need to send things over the bus to the PCB. The [[spi_servo 1.0_protocol|protocol is explained here]].
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
09f99de2b9f74d66130ee0f4108db6a9b947461e
1184
1181
2012-05-11T15:23:02Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol notes]].
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
f544001b9dc4d946487cce232d74b632d36f846a
1185
1184
2012-05-11T15:23:26Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
a415f4362491fab5e88e58848898028a28273cc3
1194
1185
2012-05-11T15:35:09Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
for the I2C connector see: [[I2C_connector_pinout]]
The pinout is standard for servo-motors;
Pin 1 is GND (near the edge of the board)
Pin 2 is VCC (5V)
Pin 3 is data
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
72dd7f719c65c5fe31e11b429e32514e75eb9454
1195
1194
2012-05-11T15:36:32Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
for the I2C connector see: [[I2C_connector_pinout]]
The pinout is standard for servo-motors;
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || Servo || PWM data.
|-
|}
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
c90dd3ccd049f11e08e8c506ee94a81376b40059
SPI Servo
0
676
1180
2012-05-11T15:13:46Z
Rew
3
moved [[SPI Servo]] to [[Servo]]: now for both SPI and I2C
wikitext
text/x-wiki
#REDIRECT [[Servo]]
91a2efa2681c79229d8ae17fbe09ea0eb6a1280b
Servo 1.0 protocol
0
126
1182
668
2012-05-11T15:21:03Z
Rew
3
moved [[Spi servo 1.0 protocol]] to [[Servo 1.0 protocol]]
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_servo board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
The default address of the servo board is 0x86.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
9bcd3ed269304b57c98c80f4f37b7ece8438e5e5
1186
1182
2012-05-11T15:24:57Z
Rew
3
/* write ports */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_servo board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
The default address of the servo board is 0x86.
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
0d1071dace009a8100fd96ee1dc9bcd47b1e7ebd
1187
1186
2012-05-11T15:25:28Z
Rew
3
/* examples */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_servo board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
The default address of the servo board is 0x86.
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
35b9edf4ab2675692a60a11e3e92bd4118e44e72
1188
1187
2012-05-11T15:26:06Z
Rew
3
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
b6ee5bf342ef5e0aa33cd553db91c0a1c0bb03df
Spi servo 1.0 protocol
0
677
1183
2012-05-11T15:21:03Z
Rew
3
moved [[Spi servo 1.0 protocol]] to [[Servo 1.0 protocol]]
wikitext
text/x-wiki
#REDIRECT [[Servo 1.0 protocol]]
acefbf4a8bc995b73f6bdfe6975378bbe0b75a16
DIO protocol
0
432
1189
1164
2012-05-11T15:27:12Z
Rew
3
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
ce802430d496654fbad24961f574f8205b8a3463
7FETs
0
49
1190
828
2012-05-11T15:28:46Z
Rew
3
moved [[SPI 7FETs]] to [[7FETs]]
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The SPI_7FETs PCB|The SPI_7FETs PCB]]
This is the documentation page for the SPI_7FETs board.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7fets board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max 4xx mA!)
Use a connector on 1-2 to provide a more powerful powersource for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "powersource".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the powersource, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
f35aa0f596e0946df5d7943d2ecb59a4e6f5ec72
1192
1190
2012-05-11T15:33:39Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. Contact us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[dio_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
a954640a0bf04fdb2c21ce4a4201367960182a20
1193
1192
2012-05-11T15:34:00Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. Contact us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
1f3bedaf5dc7f1309d18966345789ccf0f730398
SPI 7FETs
0
678
1191
2012-05-11T15:28:46Z
Rew
3
moved [[SPI 7FETs]] to [[7FETs]]
wikitext
text/x-wiki
#REDIRECT [[7FETs]]
d26a38ce65912955118c69ceb3a31313f9228f58
3FETs
0
483
1201
1012
2012-05-11T15:39:32Z
Rew
3
moved [[SPI 3FETs]] to [[3FETs]]
wikitext
text/x-wiki
This is the documentation page for the SPI_3FETs board.
== Overview ==
The board has 3 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 5A per output should be possible. Maximum voltage is 30V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3fets board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
e5adeb34d48868158b12bf6513a244b38049ef71
1204
1201
2012-05-11T15:56:51Z
Rew
3
wikitext
text/x-wiki
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[dio_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
c9e08d7ad5f5764ed9bdbf9dff28a76c769e2ae4
1205
1204
2012-05-11T15:57:09Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
fb699a45ba3da740fc0a16d491092859f08b1537
1210
1205
2012-05-11T16:05:29Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
a48eda3874d60732c9e52923f66584ce3415f016
SPI 3FETs
0
679
1202
2012-05-11T15:39:32Z
Rew
3
moved [[SPI 3FETs]] to [[3FETs]]
wikitext
text/x-wiki
#REDIRECT [[3FETs]]
b3634a98553ca548a8049bf27ad284bbad1c619f
DIO
0
52
1203
1176
2012-05-11T15:56:08Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
e3ca0ede596fb1a3c31da30217fabcb3a20b8a04
1207
1203
2012-05-11T16:02:36Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
de9e55f2c29d290c9651417e15e8872c2b9668a9
File:SPI relay.jpg
6
680
1206
2012-05-11T16:02:19Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Relay
0
53
1208
1038
2012-05-11T16:02:47Z
Tom
4
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
=== LEDs ===
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ff0500757ae08f8e0b9016a14542ba70ef61144f
1209
1208
2012-05-11T16:03:02Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
967479d029391dba8c3e33735538ae7c45ea3215
1212
1209
2012-05-11T16:06:33Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
2446427b959d32e39ea6c31dfb866a68d905f5f7
1213
1212
2012-05-11T16:10:45Z
Rew
3
/* LEDs */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
There are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a8d42506ae0a2843b937e34f6a180679bb049e86
1214
1213
2012-05-11T16:11:05Z
Rew
3
moved [[SPI relay]] to [[Relay]]
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
There are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a8d42506ae0a2843b937e34f6a180679bb049e86
File:SPI 3FETs.jpg
6
681
1211
2012-05-11T16:05:50Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
SPI relay
0
682
1215
2012-05-11T16:11:05Z
Rew
3
moved [[SPI relay]] to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
Motor
0
658
1217
1143
2012-05-11T16:12:32Z
Tom
4
/* External resources */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
[http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
To make the motor PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the motor PCB are explained in [[Spi_motor_protocol]].
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the motor board as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
73d92c6739302e4907e9450c70ffc1aa3febba86
1218
1217
2012-05-11T16:13:20Z
Tom
4
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
[http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
195624af8b77220b941568ce11ccf0c0f46b1319
1219
1218
2012-05-11T16:13:29Z
Tom
4
moved [[SPI motor]] to [[Motor]]
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
[http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
195624af8b77220b941568ce11ccf0c0f46b1319
SPI motor
0
683
1220
2012-05-11T16:13:29Z
Tom
4
moved [[SPI motor]] to [[Motor]]
wikitext
text/x-wiki
#REDIRECT [[Motor]]
7883954015c088600f1b3a6d2956e64a817f5910
FT2232H breakout board
0
12
1223
135
2012-05-11T16:14:46Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
2bd669db4b30f59f93d7aa1b44e38fac8582d0d9
1224
1223
2012-05-11T16:16:31Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
9479d2bc9f60be8474f4134559b60ed66c87f9e6
1225
1224
2012-05-11T16:19:16Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>BDBUS0</td></tr>
<tr><td>4</td><td>BDBUS1</td></tr>
<tr><td>5</td><td>BDBUS2</td></tr>
<tr><td>6</td><td>BDBUS3</td></tr>
<tr><td>7</td><td>BDBUS4</td></tr>
<tr><td>8</td><td>BDBUS5</td></tr>
<tr><td>9</td><td>BDBUS6</td></tr>
<tr><td>10</td><td>BDBUS7</td></tr>
<tr><td>11</td><td>BCBUS0</td></tr>
<tr><td>12</td><td>BCBUS1</td></tr>
<tr><td>13</td><td>BCBUS2</td></tr>
<tr><td>14</td><td>BCBUS3</td></tr>
<tr><td>15</td><td>BCBUS4</td></tr>
<tr><td>16</td><td>BCBUS5</td></tr>
<tr><td>17</td><td>BCBUS6</td></tr>
<tr><td>18</td><td>BCBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
5ff1bf46148cb8969e7cd7a5fa6698dbd73e433e
1226
1225
2012-05-11T16:21:17Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>1</td><td>ACBUS5</td></tr>
<tr><td>2</td><td>NC</td></tr>
<tr><td>3</td><td>NC</td></tr>
<tr><td>4</td><td>NC</td></tr>
<tr><td>5</td><td>ADBUS0</td></tr>
<tr><td>6</td><td>ADBUS1</td></tr>
<tr><td>7</td><td>ADBUS2</td></tr>
<tr><td>8</td><td>ADBUS3</td></tr>
<tr><td>9</td><td>ADBUS4</td></tr>
<tr><td>10</td><td>ADBUS5</td></tr>
<tr><td>11</td><td>5V</td></tr>
<tr><td>12</td><td>GND</td></tr>
<tr><td>13</td><td>ADBUS6</td></tr>
<tr><td>14</td><td>ADBUS7</td></tr>
<tr><td>15</td><td>ACBUS0</td></tr>
<tr><td>16</td><td>ACBUS1</td></tr>
<tr><td>17</td><td>ACBUS2</td></tr>
<tr><td>18</td><td>ACBUS3</td></tr>
<tr><td>19</td><td>ACBUS4</td></tr>
<tr><td>20</td><td>ACBUS5</td></tr>
<tr><td>21</td><td>ACBUS6</td></tr>
<tr><td>22</td><td>ACBUS7</td></tr>
<tr><td>23</td><td>BDBUS0</td></tr>
<tr><td>24</td><td>BDBUS1</td></tr>
<tr><td>25</td><td>BDBUS2</td></tr>
<tr><td>26</td><td>BDBUS3</td></tr>
<tr><td>27</td><td>BDBUS4</td></tr>
<tr><td>28</td><td>BDBUS5</td></tr>
<tr><td>29</td><td>3V3</td></tr>
<tr><td>30</td><td>GND</td></tr>
<tr><td>31</td><td>BDBUS6</td></tr>
<tr><td>32</td><td>BDBUS7</td></tr>
<tr><td>33</td><td>BCBUS0</td></tr>
<tr><td>34</td><td>BCBUS1</td></tr>
<tr><td>35</td><td>BCBUS2</td></tr>
<tr><td>36</td><td>BCBUS3</td></tr>
<tr><td>37</td><td>BCBUS4</td></tr>
<tr><td>38</td><td>BCBUS5</td></tr>
<tr><td>39</td><td>BCBUS6</td></tr>
<tr><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>ADBUS0</td></tr>
<tr><td>4</td><td>ADBUS1</td></tr>
<tr><td>5</td><td>ADBUS2</td></tr>
<tr><td>6</td><td>ADBUS3</td></tr>
<tr><td>7</td><td>ADBUS4</td></tr>
<tr><td>8</td><td>ADBUS5</td></tr>
<tr><td>9</td><td>ADBUS6</td></tr>
<tr><td>10</td><td>ADBUS7</td></tr>
<tr><td>11</td><td>ACBUS0</td></tr>
<tr><td>12</td><td>ACBUS1</td></tr>
<tr><td>13</td><td>ACBUS2</td></tr>
<tr><td>14</td><td>ACBUS3</td></tr>
<tr><td>15</td><td>ACBUS4</td></tr>
<tr><td>16</td><td>ACBUS5</td></tr>
<tr><td>17</td><td>ACBUS6</td></tr>
<tr><td>18</td><td>ACBUS7</td></tr>
<tr><td>19</td><td>3V3</td></tr>
<tr><td>20</td><td>3V3</td></tr>
</table>
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>ADBUS0</td><td>3</td><td>4</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>5</td><td>6</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>7</td><td>8</td><td>ADBUS5</td></tr>
<tr><td>ADBUS6</td><td>9</td><td>10</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>11</td><td>12</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>13</td><td>14</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>15</td><td>16</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>17</td><td>18</td><td>ACBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
771afe184aa6aed1a42f249a141a5db6064ad90f
Motor
0
658
1227
1219
2012-05-11T16:25:11Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
[http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the coorect jumper settings:<br>
{| border=1
! Motor voltage (connected on pin 5 and 6 of the connector above) !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
ef60c03d2cf481fa80c3ed1d8a3b891c8f83a469
1228
1227
2012-05-11T16:25:35Z
Tom
4
/* Jumper */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
[http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
da6ba0d45d1718e2aba2f6d5c66b80b2168dacb2
1235
1228
2012-05-11T16:32:59Z
Tom
4
/* Specifications */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm
Maximum motor voltage: 24V
Maximum motor current: 5A or 15A, depending on your version
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
[http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
e8a9ab2370d6d10d11a9d8e5fe1ddaa537aa23f9
1236
1235
2012-05-11T16:33:20Z
Tom
4
/* External resources */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm
Maximum motor voltage: 24V
Maximum motor current: 5A or 15A, depending on your version
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
2f300eecf93e086f4dcdee01e925be489751407b
1237
1236
2012-05-11T16:46:01Z
Tom
4
/* External resources */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm
Maximum motor voltage: 24V
Maximum motor current: 5A or 15A, depending on your version
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [www.atmel.com/Images/doc2545.pdf the CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
67cdc383e697b7ef9dc2bd360440d75915898bbc
1238
1237
2012-05-11T16:46:46Z
Tom
4
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm
Maximum motor voltage: 24V
Maximum motor current: 5A or 15A, depending on your version
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
6e4ad74d9cc8f3d9a1267f841c30c160e85eab89
1271
1238
2012-05-18T12:08:32Z
Tom
4
/* Overview */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm
Maximum motor voltage: 24V
Maximum motor current: 5A or 15A, depending on your version
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
0bb2fcc7fcb54e5f73ea3f6bd77cbed20ec7d876
1272
1271
2012-05-18T12:08:47Z
Tom
4
/* Specifications */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
963f66f51119e8e1f27111ea6a6eeb8e68a7e726
1280
1272
2012-05-21T13:07:26Z
Tom
4
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board enables you to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
4fc2ee23e58c7c41f6f7ef0dcc3599df15f02058
1315
1280
2012-05-30T12:21:12Z
Tom
4
/* Overview */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 8V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
cc9e20090cf19e923c0e14554419f0d0738a6ca5
FT2232H breakout board
0
12
1229
1226
2012-05-11T16:25:50Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>ACBUS5</td><td>1</td><td>2</td><td>NC</td></tr>
<tr><td>NC</td><td>3</td><td>4</td><td>NC</td></tr>
<tr><td>ADBUS0</td><td>5</td><td>6</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>7</td><td>8</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>9</td><td>10</td><td>ADBUS5</td></tr>
<tr><td>5V</td><td>11</td><td>12</td><td>GND</td></tr>
<tr><td>ADBUS6</td><td>13</td><td>14</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>15</td><td>16</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>17</td><td>18</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>19</td><td>20</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>21</td><td>22</td><td>ACBUS7</td></tr>
<tr><td>BDBUS0</td><td>23</td><td>24</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>25</td><td>26</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>27</td><td>28</td><td>BDBUS5</td></tr>
<tr><td>3V3</td><td>29</td><td>30</td><td>GND</td></tr>
<tr><td>BDBUS6</td><td>31</td><td>32</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>33</td><td>34</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>35</td><td>36</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>37</td><td>38</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>39</td><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>ADBUS0</td><td>3</td><td>4</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>5</td><td>6</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>7</td><td>8</td><td>ADBUS5</td></tr>
<tr><td>ADBUS6</td><td>9</td><td>10</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>11</td><td>12</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>13</td><td>14</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>15</td><td>16</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>17</td><td>18</td><td>ACBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
8a4f920e7fd9dd64202d2e8bac5df8d8955731f5
1230
1229
2012-05-11T16:26:21Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>ACBUS5</td><td>1</td><td>2</td><td>NC</td></tr>
<tr><td>NC</td><td>3</td><td>4</td><td>NC</td></tr>
<tr><td>ADBUS0</td><td>5</td><td>6</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>7</td><td>8</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>9</td><td>10</td><td>ADBUS5</td></tr>
<tr><td>5V</td><td>11</td><td>12</td><td>GND</td></tr>
<tr><td>ADBUS6</td><td>13</td><td>14</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>15</td><td>16</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>17</td><td>18</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>19</td><td>20</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>21</td><td>22</td><td>ACBUS7</td></tr>
<tr><td>BDBUS0</td><td>23</td><td>24</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>25</td><td>26</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>27</td><td>28</td><td>BDBUS5</td></tr>
<tr><td>3V3</td><td>29</td><td>30</td><td>GND</td></tr>
<tr><td>BDBUS6</td><td>31</td><td>32</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>33</td><td>34</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>35</td><td>36</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>37</td><td>38</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>39</td><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>ADBUS0</td><td>3</td><td>4</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>5</td><td>6</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>7</td><td>8</td><td>ADBUS5</td></tr>
<tr><td>ADBUS6</td><td>9</td><td>10</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>11</td><td>12</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>13</td><td>14</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>15</td><td>16</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>17</td><td>18</td><td>ACBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
70696815892c4f177cd56bdc7eb756f1c2a20fc8
1232
1230
2012-05-11T16:27:07Z
Rew
3
/* For 2.1 */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>ACBUS5</td><td>1</td><td>2</td><td>NC</td></tr>
<tr><td>NC</td><td>3</td><td>4</td><td>NC</td></tr>
<tr><td>ADBUS0</td><td>5</td><td>6</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>7</td><td>8</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>9</td><td>10</td><td>ADBUS5</td></tr>
<tr><td>5V</td><td>11</td><td>12</td><td>GND</td></tr>
<tr><td>ADBUS6</td><td>13</td><td>14</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>15</td><td>16</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>17</td><td>18</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>19</td><td>20</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>21</td><td>22</td><td>ACBUS7</td></tr>
<tr><td>BDBUS0</td><td>23</td><td>24</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>25</td><td>26</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>27</td><td>28</td><td>BDBUS5</td></tr>
<tr><td>3V3</td><td>29</td><td>30</td><td>GND</td></tr>
<tr><td>BDBUS6</td><td>31</td><td>32</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>33</td><td>34</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>35</td><td>36</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>37</td><td>38</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>39</td><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>ADBUS0</td><td>3</td><td>4</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>5</td><td>6</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>7</td><td>8</td><td>ADBUS5</td></tr>
<tr><td>ADBUS6</td><td>9</td><td>10</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>11</td><td>12</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>13</td><td>14</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>15</td><td>16</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>17</td><td>18</td><td>ACBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see J2 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
91d4971ca1cea71e92cfeaf7ce15bf2db049d84a
Solder jumpers
0
72
1231
345
2012-05-11T16:26:59Z
Tom
4
/* Solder jumpers */
wikitext
text/x-wiki
== Solder jumpers ==
[[File:solder_jumper_normal.JPG|none|thumb|300px|alt=Trace still intact|Trace still intact]]
Carefully(!!!) cut the narrow trace between the middle and right pad with a sharp knife:
[[File:solder_jumper_cut.JPG|none|thumb|300px|alt=Trace is cut|Trace is cut]]
Place a solder jumper over the other two pads:
[[File:solder_jumper_soldered.JPG|none|thumb|300px|alt=New connection is created|New connection is created]]
5371e5dea2676e8cc822199f66711f4e50c06d18
Main Page
0
1
1233
1222
2012-05-11T16:28:50Z
Tom
4
/* SPI */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[SPI_LM35]]
* [[Relay|SPI_relay]]
* [[motor|SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[I2C_LM35]]
* [[relay|I2C_relay]]
* [[motor|I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
b0df528dfd9e4740a028cf776207c14ced428d72
1242
1233
2012-05-11T16:59:48Z
Tom
4
/* SPI */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[temp|SPI_temp]]
* [[Relay|SPI_relay]]
* [[motor|SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[I2C_LM35]]
* [[relay|I2C_relay]]
* [[motor|I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
fe0129cfe19308acdee8a006915f6abc3ed55fc4
1243
1242
2012-05-11T17:00:00Z
Tom
4
/* I2C */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
* [[DIO|SPI_DIO]]
* [[Servo|SPI_Servo]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[temp|SPI_temp]]
* [[Relay|SPI_relay]]
* [[motor|SPI_motor]]
== I2C ==
* [[I2C_LCD]]
* [[DIO|I2C_DIO]]
* [[Servo|I2C_Servo]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[temp|I2C_temp]]
* [[relay|I2C_relay]]
* [[motor|I2C_motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
5f7e234013b36602fe41bf09d8de5578ca8fbcb3
1282
1243
2012-05-21T13:12:33Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== SPI ==
* [[SPI_LCD]]
== I2C ==
* [[I2C_LCD]]
== General pages ==
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
4c997c517bdb4cc738a5cf2e9d7529a07f46fad3
1286
1282
2012-05-21T14:52:15Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
e925a36ecac4e5d8a0b113b851132e67e2ec0e75
1287
1286
2012-05-21T14:52:23Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
b687a952bcdc456641691309e0fa35f762bba74e
Raspberry pi expansion system page
0
86
1234
929
2012-05-11T16:31:20Z
Rew
3
/* expansion boards */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
For some things like standard RS232 serial ports or webcams, you can get cheap USB devices. But to drive a small 16x2 character LCD, or to switch mains-power rpi_serial is for you.
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= expansion boards =
The following expansion boards have been designed:
* [[SPI_LCD]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[Servo|SPI_Servo]]
* [[LM35|SPI_LM35]]
* [[DIO|SPI_DIO]]
* [[Relay|SPI_relay]]
* [[I2C_LCD]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[Servo|I2C_Servo]]
* [[LM35|I2C_LM35]]
* [[DIO|I2C_DIO]]
* [[Relay|I2C_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
These expansion boards have two SPI connectors. The first SPI connector is for data transfer during normal operation. The other can be used to daisy-chain the SPI bus to other SPI expansion boards. Or it can be configured to be used as the programming port for the onboard AVR chip.
It should be possible to use one of the raspberry pi SPI buses for data-transfer, while you use the other one to program the AVR chip on the expansion board.
5ffec48ef23d95e0bd7c5a2cf162329752792f56
File:SPI motor.jpg
6
684
1239
2012-05-11T16:49:57Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Temperature Interface
0
51
1240
1037
2012-05-11T16:59:30Z
Tom
4
moved [[SPI LM35]] to [[Temp]]
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
84fea4660fc499c202aa1206f8831f711d7e1127
1244
1240
2012-05-11T17:00:38Z
Tom
4
/* Programming */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_LM35 board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
dd70ceaf07dece813ee5d50f02495c80720de113
1245
1244
2012-05-11T17:00:48Z
Tom
4
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the temp board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
b41b8f2c437d14e721cab2bfc14d4311db2da07d
1246
1245
2012-05-11T17:01:37Z
Tom
4
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f72614d1202bcf48a476e49afe54ffc4136082e3
SPI LM35
0
685
1241
2012-05-11T16:59:30Z
Tom
4
moved [[SPI LM35]] to [[Temp]]
wikitext
text/x-wiki
#REDIRECT [[Temp]]
545b4b5e739a9cb2651d39415baf49317d026c07
Motor protocol
0
657
1278
1136
2012-05-21T13:07:03Z
Tom
4
moved [[Spi motor protocol]] to [[Motor protocol]]
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position.
|-
| 0x41 || set target position.
|-
| 0x42 || set relative position.
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
6d7402b7b801fbb55b59f33fbf972823892db442
1281
1278
2012-05-21T13:08:45Z
Tom
4
/* read ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position.
|-
| 0x41 || set target position.
|-
| 0x42 || set relative position.
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position.
|-
| 0x41 || read target position.
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
fa0d86f11f76ad8e81702c410f2d15d59c9df05d
1306
1281
2012-05-25T09:12:35Z
Tom
4
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position.
|-
| 0x41 || set target position.
|-
| 0x42 || set relative position.
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position.
|-
| 0x41 || read target position.
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
41060417a6251759561f280625c2a09b7c1fdc48
1307
1306
2012-05-25T10:17:33Z
Tom
4
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position.
|-
| 0x41 || set target position.
|-
| 0x42 || set relative position.
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position.
|-
| 0x41 || read target position.
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
cf190a965e675a4b8edbc7ba4b3c6941dc1db6b8
Spi motor protocol
0
715
1279
2012-05-21T13:07:03Z
Tom
4
moved [[Spi motor protocol]] to [[Motor protocol]]
wikitext
text/x-wiki
#REDIRECT [[Motor protocol]]
4adb50c6ad9c93d801f96c97f5aadffff164f144
LCD
0
716
1283
2012-05-21T13:36:15Z
Tom
4
Created page with "[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]] This is the documentation page for the SPI_LCD and I2C_LCD boards. == Overview == == Assembly ins..."
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
=== Possible Configurations ===
The second SPI port can be used as an ICSP connector.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
beb967be59f7fbea1629a41190f5063ac1fc1768
1316
1283
2012-05-31T05:41:35Z
Rew
3
/* Assembly instructions */
wikitext
text/x-wiki
[[File:SPI_LCD.jpg|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled.
If you got the version without the LCD, we recommend you put pin headers on the LCD and plug that into the provided female connector.
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same: remove the female connector provided and solder in a pin header. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
=== Possible Configurations ===
The second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
90698ed7c4d73bfe4ff50965deabd1228462b514
I2C LCD
0
618
1284
1067
2012-05-21T14:51:29Z
Tom
4
Redirected page to [[LCD]]
wikitext
text/x-wiki
#REDIRECT [[LCD]]
b1da9777d2df6c9d224be3d618986f2f704359f0
SPI LCD
0
48
1285
1060
2012-05-21T14:51:46Z
Tom
4
Redirected page to [[LCD]]
wikitext
text/x-wiki
#REDIRECT [[LCD]]
b1da9777d2df6c9d224be3d618986f2f704359f0
Raspberry Pi Serial
0
59
1309
971
2012-05-29T13:06:35Z
Rew
3
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
None.
=== ===
* Initial public release
15aef6a57a3baf6ab6b95d1c0f2ff157c95aa5b9
1310
1309
2012-05-29T13:07:08Z
Rew
3
/* */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
None.
=== changelog ===
* Initial public release
35d37d7c00e8aa565598ea28887c93ee08b8cc66
1311
1310
2012-05-29T13:10:43Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
You can send things from your 'pi to the I2C and SPI busses using the tools from:
http://www.bitwizard.nl/software/gpio_spi_i2c_20120419.tgz
Work is still underway to make a kernel-level driver for I2C and SPI.
=== changelog ===
* Initial public release
c694ef553648d651c110ed71b564573e8f57e961
1322
1311
2012-06-01T11:57:52Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
You can send things from your 'pi to the I2C and SPI busses using the tools from:
http://www.bitwizard.nl/software/gpio_spi_i2c_20120419.tgz
Work is still underway to make a kernel-level driver for I2C and SPI.
=== changelog ===
* Initial public release
3c7822ab403b8e1006549136bbd11f68f31dbdd7
1326
1322
2012-06-01T15:28:47Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
You can send things from your 'pi to the I2C and SPI busses using the tools from:
http://www.bitwizard.nl/software/gpio_spi_i2c_20120419.tgz
Work is still underway to make a kernel-level driver for I2C and SPI.
=== changelog ===
* Initial public release
da70eb49aa5bd3d32bfd218eb7476a117947f516
1327
1326
2012-06-01T15:31:22Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
You can send things from your 'pi to the I2C and SPI busses using the tools from:
http://www.bitwizard.nl/software/gpio_spi_i2c_20120419.tgz
Work is still underway to make a kernel-level driver for I2C and SPI.
=== changelog ===
* Initial public release
65a6b14d3a8f10a6c889c8e2050d2d051bde7983
Talk:Raspberry Pi Serial
1
743
1321
2012-06-01T11:38:45Z
Dgoadby
704
Created page with "I recently took delivery of three Raspberry Pi Serial boards and the 5V link was made contrary to the main text. The serial connections are not shown here and the board scree..."
wikitext
text/x-wiki
I recently took delivery of three Raspberry Pi Serial boards and the 5V link was made contrary to the main text.
The serial connections are not shown here and the board screen print just shows VTRG so I assume that V is +5V, T is transmitted data, R is received data and G is ground. I just got my RPi today so will confirm this later.
c49c4a29bfb299976e42782208b0bf786265209d
1325
1321
2012-06-01T12:13:52Z
Rew
3
wikitext
text/x-wiki
(D:) I recently took delivery of three Raspberry Pi Serial boards and the 5V link was made contrary to the main text.
(REW:) Yes, correct. We'll fix the documentation. We now ship the boards preconfigured for 5V.
(D:) The serial connections are not shown here and the board screen print just shows VTRG so I assume that V is +5V, T is transmitted data, R is received data and G is ground. I just got my RPi today so will confirm this later.
(REW:) Correct. I added a page about the async port.
881e1d4a11afeb369ee3377f0e28b7d25143f59f
Uart connector pinout
0
744
1323
2012-06-01T12:10:08Z
Rew
3
Created page with " The rpi_serial and ftdi_serial boards use a 4-pin connector. The connector is laid out as follows: {| border=1 ! pin !! function !! remark |- | 1 || GND || Power Ground |..."
wikitext
text/x-wiki
The rpi_serial and ftdi_serial boards use a 4-pin connector.
The connector is laid out as follows:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || RXD || recieve Data (input)
|-
| 3 || TXD || transmit data (output)
|-
| 4 || VCC || Power 5V (or 3.3V).
|-
|}
To connect the RPI_SERIAL to an ftdi_serial board, you'll need a null modem (crossover) cable. You can consider leaving the power line unconnected. (on both boards you can power a small project from this pin. For example an AVR processor can easily communicate with the RPI over the serial connection and at the same time be powered from the power pin.)
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || RXD || D1 || TXD on the arduino
|-
| 3 || TXD || D0 || RXD on the arduino
|-
| 4 || VCC || VCC || VCC
|-
|}
Note that there is also the FT232 or whatever USB-serial chip you have connected to these pins.
To connect your arduino to the raspberry pi, we recommend you use USB.
On the other hand, the above setup will be useful if you then take the chip out of the arduino and build a project with the bare chip.
696d61e250f484e26ffc398f57f78bfa160bdd41
1324
1323
2012-06-01T12:11:24Z
Rew
3
/* Connecting the BitWizard boards to an Arduino */
wikitext
text/x-wiki
The rpi_serial and ftdi_serial boards use a 4-pin connector.
The connector is laid out as follows:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || RXD || recieve Data (input)
|-
| 3 || TXD || transmit data (output)
|-
| 4 || VCC || Power 5V (or 3.3V).
|-
|}
To connect the RPI_SERIAL to an ftdi_serial board, you'll need a null modem (crossover) cable. You can consider leaving the power line unconnected. (on both boards you can power a small project from this pin. For example an AVR processor can easily communicate with the RPI over the serial connection and at the same time be powered from the power pin.)
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || RXD || D1 || TXD on the arduino
|-
| 3 || TXD || D0 || RXD on the arduino
|-
| 4 || VCC || VCC || VCC
|-
|}
Note that there is also the FT232(*) USB-serial chip connected to these pins.
To connect your arduino to the raspberry pi, we recommend you use USB.
On the other hand, the above setup will be useful if you then take the chip out of the arduino and build a project with the bare chip.
(*) It's an at90usb162 on newer arduinos IIRC.
0618bd45f18157b170dd7f375c77b12fc6723150
File:LCD config 1.JPG
6
751
1334
2012-06-05T13:19:51Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:LCD config 2.JPG
6
752
1335
2012-06-05T13:20:06Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:LCD config 3.JPG
6
753
1336
2012-06-05T13:20:21Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:LCD config 4.JPG
6
754
1337
2012-06-05T13:20:38Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:LCD config 5.JPG
6
755
1338
2012-06-05T13:20:56Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:LCD config 2.JPG
6
752
1339
1335
2012-06-05T13:21:25Z
Tom
4
moved [[File:LCD config 21.JPG]] to [[File:LCD config 2.JPG]]
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:LCD config 21.JPG
6
756
1340
2012-06-05T13:21:25Z
Tom
4
moved [[File:LCD config 21.JPG]] to [[File:LCD config 2.JPG]]
wikitext
text/x-wiki
#REDIRECT [[File:LCD config 2.JPG]]
fd5ee8df9117c765a4857434ec9ad048e2cb0813
File:DSC04653.JPG
6
757
1341
2012-06-05T13:22:37Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
LCD
0
716
1342
1316
2012-06-05T13:27:45Z
Tom
4
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
The second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
1687b40ab83bd6bc72492b3ca09f3f9b8fc90611
1408
1342
2012-06-15T15:20:19Z
Rew
3
/* Additional software */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
The second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
ef8bf533c220225232ba51fc30e86d74ecc4cfec
1409
1408
2012-06-15T15:56:40Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
8b811d19a8553153e6e2f294e7c63a3e66477db4
1410
1409
2012-06-17T07:12:57Z
Rew
3
/* Additional software */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
e75cdd9ce8c072da17c970e206a7738e970474ce
1411
1410
2012-06-17T07:37:21Z
Rew
3
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
d19f645896d767af407fa1fa3d8f808f0fbc79e3
1416
1411
2012-06-17T23:15:25Z
Tom
4
/* Related projects */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
20bab01d5f1480273a6aef90dcd5a97d23d6f700
Motor protocol
0
657
1345
1307
2012-06-06T12:08:36Z
Tom
4
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position.
|-
| 0x41 || read target position.
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
9066857f784083a59bcba9282d12f2eb1ccbb928
1346
1345
2012-06-06T12:08:44Z
Tom
4
/* read ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
a1854e476ba02c53623d0fe0d6ae9f463b4c1de8
1347
1346
2012-06-06T12:09:54Z
Tom
4
/* move stepper to step 0x1234 */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
5c6571ad9b3e7475318a3a046ec911705ce34d5b
Main Page
0
1
1348
1287
2012-06-06T13:31:27Z
Tom
4
/* Sample programs */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi I2C LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
134c8d2197b381fde86fbdb53ce398f522a954b5
1352
1348
2012-06-06T13:43:26Z
Tom
4
/* Sample programs */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
604d095d3342f48d34defdc03e4d72eff44253ce
1412
1352
2012-06-17T21:00:29Z
Tom
4
/* Sample projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
93ac534fca709d0e7bf5fe34ae6804239aa47a89
1417
1412
2012-06-18T14:47:00Z
Tom
4
/* General pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
c63b085d93b263d4ec500162b2d5a74f7e8d06a9
Raspberry Pi LCD program
0
760
1349
2012-06-06T13:43:06Z
Tom
4
Created page with "== Command line arguments == -a <addr> address of display, defaults to 0x82 -p <l> <c> Jump to line <l> and character <c> -t <text> print text -..."
wikitext
text/x-wiki
== Command line arguments ==
-a <addr> address of display, defaults to 0x82
-p <l> <c> Jump to line <l> and character <c>
-t <text> print text
-T <l> <c> <text> Print tekst
-b <> Adjust backlight level
-C <> Adjust contrast
-r clear/reset/reinitialise? display
-f <file> display text from file
== Example commands ==
Print current date on line 0:
LCD -p 0 0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 1 2 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -l 0 -c 0 -t display0
LCD -a 84 -l 0 -c 0 -t display1
365f6ed71e3cb0c67b8d25f590c753a8cd01fbe1
1350
1349
2012-06-06T13:43:13Z
Tom
4
moved [[Raspberry Pi I2C LCD program]] to [[Raspberry Pi LCD program]]
wikitext
text/x-wiki
== Command line arguments ==
-a <addr> address of display, defaults to 0x82
-p <l> <c> Jump to line <l> and character <c>
-t <text> print text
-T <l> <c> <text> Print tekst
-b <> Adjust backlight level
-C <> Adjust contrast
-r clear/reset/reinitialise? display
-f <file> display text from file
== Example commands ==
Print current date on line 0:
LCD -p 0 0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 1 2 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -l 0 -c 0 -t display0
LCD -a 84 -l 0 -c 0 -t display1
365f6ed71e3cb0c67b8d25f590c753a8cd01fbe1
1353
1350
2012-06-06T14:03:54Z
Rew
3
/* Command line arguments */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b <b> Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
== Example commands ==
Print current date on line 0:
LCD -p 0 0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 1 2 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -l 0 -c 0 -t display0
LCD -a 84 -l 0 -c 0 -t display1
7c763aa13520acd5d4b17ab473fcf69a0056e596
1354
1353
2012-06-06T14:05:24Z
Rew
3
/* Command line arguments */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
== Example commands ==
Print current date on line 0:
LCD -p 0 0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 1 2 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -l 0 -c 0 -t display0
LCD -a 84 -l 0 -c 0 -t display1
3a69f49bef49b2d587e1418e846bcb64d3190a2c
1355
1354
2012-06-06T14:06:44Z
Rew
3
/* Example commands */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
== Example commands ==
Print current date on line 0:
LCD -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 2,1 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -T 0,0 display0
LCD -a 84 -T 0,0 display1
e57cd5427766f902ed480a59fece9f35cfb6070d
1356
1355
2012-06-06T14:07:08Z
Rew
3
/* Command line arguments */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
== Example commands ==
Print current date on line 0:
LCD -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 2,1 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -T 0,0 display0
LCD -a 84 -T 0,0 display1
bb3c033dafe2657f98921acf9c197dc1c966b599
1357
1356
2012-06-06T14:07:24Z
Rew
3
/* Command line arguments */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
== Example commands ==
Print current date on line 0:
LCD -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 2,1 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -T 0,0 display0
LCD -a 84 -T 0,0 display1
870b112f54c65623e750012fa24c1605d16a1ef6
1358
1357
2012-06-06T14:07:33Z
Rew
3
/* Command line arguments */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
== Example commands ==
Print current date on line 0:
LCD -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 2,1 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -T 0,0 display0
LCD -a 84 -T 0,0 display1
53b912834b4a99d42cfd70b10baee669a886cd55
1359
1358
2012-06-06T14:09:16Z
Rew
3
/* Command line arguments */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
LCD -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
LCD -T 2,1 "Hello World"
Print the contents of "textfile":
LCD -f textfile
Write two different strings to two daisy-chained displays:
LCD -a 82 -T 0,0 display0
LCD -a 84 -T 0,0 display1
87bf7dfcbd160859a5911387f862c6815765cc71
1360
1359
2012-06-06T14:48:17Z
Rew
3
/* Example commands */
wikitext
text/x-wiki
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
798414b3c94d1808adb8ad041343525243cb71f4
1361
1360
2012-06-06T14:56:23Z
Rew
3
/* Command line arguments */
wikitext
text/x-wiki
== download ==
download the program source from http://www.bitwizard.nl/software/bw_lcd.c
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
b59e6d639a4295035d97c597234c1192d2053657
1362
1361
2012-06-06T14:57:33Z
Rew
3
/* download */
wikitext
text/x-wiki
== download ==
download the program source from http://www.bitwizard.nl/software/bw_lcd.c
You will need a kernel with spidev enabled and the raspberry pi SPI driver included. See [[Raspberry pi spi kernel]]
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
f982349d6b3f5daeee4ff00ac8fc4213e7c47072
1372
1362
2012-06-07T10:24:00Z
Rew
3
/* download */
wikitext
text/x-wiki
== download ==
download the program source from http://www.bitwizard.nl/software/bw_lcd.c
You will need a kernel with spidev enabled and the raspberry pi SPI driver included. See [[Raspberry pi spi kernel]]
Currently you also need the http://www.bitwizard.nl/software/gpio_spi_i2c_20120419.tgz programs: You need to set gpio 7 through 11 to "ALT0":
gpio_setfunc 7 ALT0
gpio_setfunc 8 ALT0
gpio_setfunc 9 ALT0
gpio_setfunc 10 ALT0
gpio_setfunc 11 ALT0
This won't be neccesary when this code is included in the SPI driver.
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
76cb479fc14ea0a0fb8688ad943343d2703f6652
1375
1372
2012-06-07T11:31:46Z
Rew
3
/* download */
wikitext
text/x-wiki
== download ==
download the program source from http://www.bitwizard.nl/software/bw_lcd.c
You will need a kernel with spidev enabled and the raspberry pi SPI driver included. See [[Raspberry pi spi kernel]]
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
f982349d6b3f5daeee4ff00ac8fc4213e7c47072
1379
1375
2012-06-07T15:41:32Z
Rew
3
/* download */
wikitext
text/x-wiki
== download ==
download the program source from http://www.bitwizard.nl/software/bw_lcd.c
You will need a kernel with spidev enabled and the raspberry pi SPI driver included. See [[Raspberry pi spi kernel]]
This program works well with the rpi_serial board http://www.bitwizard.nl/catalog/product_info.php?cPath=25&products_id=69 and the spi_lcd board: http://www.bitwizard.nl/catalog/product_info.php?products_id=89 .
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
df2e203da274b888970fdf68b59ec459290f3597
Raspberry Pi I2C LCD program
0
761
1351
2012-06-06T13:43:13Z
Tom
4
moved [[Raspberry Pi I2C LCD program]] to [[Raspberry Pi LCD program]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi LCD program]]
23e1a07bbb239339468aa094f41cabd5937b8cde
Raspberry pi spi kernel
0
762
1363
2012-06-06T15:02:09Z
Rew
3
Created page with " You can download the raspberry pi spi kernel from http:/www.bitwizard.nl/software/rpi-binary-kernel-20120606.tgz (or remove the last pathname component to see if there is a n..."
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http:/www.bitwizard.nl/software/rpi-binary-kernel-20120606.tgz (or remove the last pathname component to see if there is a newer version.).
2aaec4219c93375b2acd7de61cc3ca1514678b39
1364
1363
2012-06-06T15:02:20Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120606.tgz (or remove the last pathname component to see if there is a newer version.).
822b6c152a5571ac53684eff63877c4481563789
1365
1364
2012-06-06T15:05:44Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120606.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120606.patch
d7857d0e6b0330f63f07d674f736c8b10eb6ce29
1366
1365
2012-06-06T15:07:49Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120606.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120606.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl
06648e0f05b3e03c8d61342603da8ccc86babf4e
1367
1366
2012-06-06T15:15:43Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120606.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120606.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl
You should start with the standard kernel for raspberry pi from github.
4fa72e75d7994d0496b591427c69bfa04e5495a1
1368
1367
2012-06-06T15:15:55Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120606.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120606.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl .
You should start with the standard kernel for raspberry pi from github.
e94d0bfc62e82501e853da2f4b827be3866c09ce
1369
1368
2012-06-07T10:06:11Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120607.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120606.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl .
You should start with the standard kernel for raspberry pi from github.
94fc984a2a9d641444ba8eeb24fbbd23b188a2e7
1376
1369
2012-06-07T11:32:16Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120607.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120607.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl .
You should start with the standard kernel for raspberry pi from github.
87213cc4763d9be8e945cdeb976e2a0382b88773
1378
1376
2012-06-07T15:39:47Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120607.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120607.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl .
You should start with the standard kernel for raspberry pi from github.
This kernel interfaces nicely with the [[Raspberry Pi LCD program]] (i.e. was developed with/ tested with).
1189ad777e5d639afe69f7d4aec899e49f046ab7
1392
1378
2012-06-09T07:26:45Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-binary-kernel-20120608.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120608.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl .
You should start with the standard kernel for raspberry pi from github.
This kernel interfaces nicely with the [[Raspberry Pi LCD program]] (i.e. was developed with/ tested with).
29ea7ce8551f09ab725916caf0e41a01b2b0e207
1393
1392
2012-06-09T07:28:42Z
Rew
3
wikitext
text/x-wiki
You can download the raspberry pi spi kernel from http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz (or remove the last pathname component to see if there is a newer version.).
The tarfile contains a boot/kernel.img, boot/system.map (should you get kernel oopses we can look up the symbols) and the /lib/modules/ directory. I suggest you use a spare SD card and unpack this to the root of your SD card, or be prepared to reinitialize your SD card should something go wrong (i.e. can no longer boot). (I don't expect so, but just to be sure).
The patch if you want to compile your own kernel is at: http://www.bitwizard.nl/software/rpi-spi-20120608.patch
The patch was written by A Robinson<arobinson@cs.man.ac.uk> and improved/fixed by R.E.Wolff@BitWizard.nl .
You should start with the standard kernel for raspberry pi from github.
This kernel interfaces nicely with the [[Raspberry Pi LCD program]] (i.e. was developed with/ tested with).
9e43f42f76202d9966a68e92a946e19be08e28bb
Beginners guide to SPI on Raspberry Pi
0
794
1413
2012-06-17T22:24:54Z
Tom
4
Created page with "= Introduction = In this guide, I will show you how to get SPI up and running, on a Raspberry Pi. We will start from scratch, with a blank SD card. = Things we will be using..."
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running, on a Raspberry Pi. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip Debian image for Raspberry Pi]
* [http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz Modified kernel and modules]
* [http://www.bitwizard.nl/software/bw_lcd.c bw_lcd program]
Unpack the first two packages, I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, en plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (75MB) partition (mounted as /media/95F5-0D7A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.6GB) partition, containing all other data (mounted as /media/18c27e44-ad29-4264-9506-c93bb7083f47 on my system). You may need to change the target directory in the following commands.
Copy the relevant data:
cp rpi-spi-binary-kernel-20120608/boot/* /media
sudo rsync -aPv rpi-spi-binary-kernel-20120608/lib/ /media/18c27e44-ad29-4264-9506-c93bb7083f47/lib/
cp bw_lcd.c /media/18c27e44-ad29-4264-9506-c93bb7083f47/home/pi/
Enable ssh on your pi:
mv /media/95F5-0D7A/boot_enable_ssh.rc /media/95F5-0D7A/boot.rc
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/
And remove the SD card from your reader.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and wait... If you haven't connected a monitor, you can remove power to your Pi after 2 minutes, and reconnect it. If you do have a monitor attached, you can power cycle your pi if "Stopping portmap daemon..." takes more than 5 seconds.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Now we need to compile the bw_lcd.c program:
gcc -o bw_lcd bw_lcd.c
And now, it's time to play! Let's try to display our first text:
sudo ./bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program van also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem below. We will respond as soon as we can, and post the problems and solutions on this page.
1689d308ccddbb09b6c981a00fef120a53ae6fd4
1414
1413
2012-06-17T22:59:15Z
Tom
4
/* Introduction */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running, on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip Debian image for Raspberry Pi]
* [http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz Modified kernel and modules]
* [http://www.bitwizard.nl/software/bw_lcd.c bw_lcd program]
Unpack the first two packages, I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, en plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (75MB) partition (mounted as /media/95F5-0D7A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.6GB) partition, containing all other data (mounted as /media/18c27e44-ad29-4264-9506-c93bb7083f47 on my system). You may need to change the target directory in the following commands.
Copy the relevant data:
cp rpi-spi-binary-kernel-20120608/boot/* /media
sudo rsync -aPv rpi-spi-binary-kernel-20120608/lib/ /media/18c27e44-ad29-4264-9506-c93bb7083f47/lib/
cp bw_lcd.c /media/18c27e44-ad29-4264-9506-c93bb7083f47/home/pi/
Enable ssh on your pi:
mv /media/95F5-0D7A/boot_enable_ssh.rc /media/95F5-0D7A/boot.rc
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/
And remove the SD card from your reader.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and wait... If you haven't connected a monitor, you can remove power to your Pi after 2 minutes, and reconnect it. If you do have a monitor attached, you can power cycle your pi if "Stopping portmap daemon..." takes more than 5 seconds.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Now we need to compile the bw_lcd.c program:
gcc -o bw_lcd bw_lcd.c
And now, it's time to play! Let's try to display our first text:
sudo ./bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program van also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem below. We will respond as soon as we can, and post the problems and solutions on this page.
0fb3b713d8136ef280497d5a9dd8c10ee3825ca6
1415
1414
2012-06-17T22:59:26Z
Tom
4
/* Introduction */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip Debian image for Raspberry Pi]
* [http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz Modified kernel and modules]
* [http://www.bitwizard.nl/software/bw_lcd.c bw_lcd program]
Unpack the first two packages, I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, en plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (75MB) partition (mounted as /media/95F5-0D7A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.6GB) partition, containing all other data (mounted as /media/18c27e44-ad29-4264-9506-c93bb7083f47 on my system). You may need to change the target directory in the following commands.
Copy the relevant data:
cp rpi-spi-binary-kernel-20120608/boot/* /media
sudo rsync -aPv rpi-spi-binary-kernel-20120608/lib/ /media/18c27e44-ad29-4264-9506-c93bb7083f47/lib/
cp bw_lcd.c /media/18c27e44-ad29-4264-9506-c93bb7083f47/home/pi/
Enable ssh on your pi:
mv /media/95F5-0D7A/boot_enable_ssh.rc /media/95F5-0D7A/boot.rc
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/
And remove the SD card from your reader.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and wait... If you haven't connected a monitor, you can remove power to your Pi after 2 minutes, and reconnect it. If you do have a monitor attached, you can power cycle your pi if "Stopping portmap daemon..." takes more than 5 seconds.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Now we need to compile the bw_lcd.c program:
gcc -o bw_lcd bw_lcd.c
And now, it's time to play! Let's try to display our first text:
sudo ./bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program van also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem below. We will respond as soon as we can, and post the problems and solutions on this page.
c30ab4fb2a4084189723a2c21496227ce027d77c
1420
1415
2012-06-19T23:01:11Z
Tom
4
/* Preparing the SD card */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip Debian image for Raspberry Pi]
* [http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz Modified kernel and modules]
* [http://www.bitwizard.nl/software/bw_lcd.c bw_lcd program]
Unpack the first two packages, I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, en plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (75MB) partition (mounted as /media/95F5-0D7A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.6GB) partition, containing all other data (mounted as /media/18c27e44-ad29-4264-9506-c93bb7083f47 on my system). You may need to change the target directory in the following commands.
Copy the relevant data:
cp rpi-spi-binary-kernel-20120608/boot/* /media/95F5-0D7A/
sudo rsync -aPv rpi-spi-binary-kernel-20120608/lib/ /media/18c27e44-ad29-4264-9506-c93bb7083f47/lib/
cp bw_lcd.c /media/18c27e44-ad29-4264-9506-c93bb7083f47/home/pi/
Enable ssh on your pi:
mv /media/95F5-0D7A/boot_enable_ssh.rc /media/95F5-0D7A/boot.rc
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/
And remove the SD card from your reader.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and wait... If you haven't connected a monitor, you can remove power to your Pi after 2 minutes, and reconnect it. If you do have a monitor attached, you can power cycle your pi if "Stopping portmap daemon..." takes more than 5 seconds.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Now we need to compile the bw_lcd.c program:
gcc -o bw_lcd bw_lcd.c
And now, it's time to play! Let's try to display our first text:
sudo ./bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program van also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem below. We will respond as soon as we can, and post the problems and solutions on this page.
806d3aeef32bad4c6ec77158ba0d347ce08e7043
DIO protocol
0
432
1421
1189
2012-06-21T13:03:25Z
Tom
4
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Set PWM value for output 0 (only workson dio software version 1.1 and higher)
|-
| 0x51 || Set PWM value for output 1 (only workson dio software version 1.1 and higher)
|-
| 0x52 || Set PWM value for output 2 (only workson dio software version 1.1 and higher)
|-
| 0x53 || Set PWM value for output 3 (only workson dio software version 1.1 and higher)
|-
| 0x54 || Set PWM value for output 4 (only workson dio software version 1.1 and higher)
|-
| 0x55 || Set PWM value for output 5 (only workson dio software version 1.1 and higher)
|-
| 0x56 || Set PWM value for output 6 (only workson dio software version 1.1 and higher)
|-
| 0x5f || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
4a828c9d3c6097f22d49668f0a8ef4ef5385ec09
1422
1421
2012-06-21T13:06:05Z
Tom
4
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Set PWM value for output 0 (only workson dio software version 1.1 and higher)
|-
| 0x51 || Set PWM value for output 1 (only workson dio software version 1.1 and higher)
|-
| 0x52 || Set PWM value for output 2 (only workson dio software version 1.1 and higher)
|-
| 0x53 || Set PWM value for output 3 (only workson dio software version 1.1 and higher)
|-
| 0x54 || Set PWM value for output 4 (only workson dio software version 1.1 and higher)
|-
| 0x55 || Set PWM value for output 5 (only workson dio software version 1.1 and higher)
|-
| 0x56 || Set PWM value for output 6 (only workson dio software version 1.1 and higher)
|-
| 0x5f || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Return PWM value for output 0 (only workson dio software version 1.1 and higher)
|-
| 0x51 || Return PWM value for output 1 (only workson dio software version 1.1 and higher)
|-
| 0x52 || Return PWM value for output 2 (only workson dio software version 1.1 and higher)
|-
| 0x53 || Return PWM value for output 3 (only workson dio software version 1.1 and higher)
|-
| 0x54 || Return PWM value for output 4 (only workson dio software version 1.1 and higher)
|-
| 0x55 || Return PWM value for output 5 (only workson dio software version 1.1 and higher)
|-
| 0x56 || Return PWM value for output 6 (only workson dio software version 1.1 and higher)
|-
| 0x5f || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
c0e2e4995919edf197386b991c96e5d4c83ecbe8
Raspberry Pi LCD program
0
760
1423
1379
2012-06-26T17:46:28Z
Tom
4
/* Example commands */
wikitext
text/x-wiki
== download ==
download the program source from http://www.bitwizard.nl/software/bw_lcd.c
You will need a kernel with spidev enabled and the raspberry pi SPI driver included. See [[Raspberry pi spi kernel]]
This program works well with the rpi_serial board http://www.bitwizard.nl/catalog/product_info.php?cPath=25&products_id=69 and the spi_lcd board: http://www.bitwizard.nl/catalog/product_info.php?products_id=89 .
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
My Pi runs the following script every minute:
#! /bin/sh
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 'My wlan0 IP is'
./bw_lcd -a 80 -T 0,1 `/sbin/ifconfig wlan0 | sed '/inet\ /!d;s/.*r://g;s/\ .*//g'`
./bw_lcd -a 82 -T 0,0 'My eth0 IP is'
./bw_lcd -a 82 -T 0,1 `/sbin/ifconfig eth0 | sed '/inet\ /!d;s/.*r://g;s/\ .*//g'`
This prints the IP addresses of both network interfaces on my two displays.
2099235a1c5ed6a48ce0ac1eb0af1e07e182ae98
Main Page
0
1
1429
1417
2012-06-29T13:05:34Z
Tom
4
/* Miscellaneous */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system. If you are considering adding information that is not related to one of our products, please contact us beforehand. It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
2c29b4a011222a0912b15b2eeeb335c27e10ea72
1436
1429
2012-06-29T13:42:18Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
2d4d626e196be41156f2a5a45fd199c45ea4c44e
1467
1436
2012-07-11T12:24:31Z
Tom
4
/* General pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
9178ca87c6b2ead1ae0aa9db52da11cbfeabc8ff
1498
1467
2012-07-16T15:34:59Z
Tom
4
/* Sample projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]]
= Raspberry Pi projects =
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
9f666103dab1b72a828114a1b7ecf0734ce0ce21
1499
1498
2012-07-16T15:37:26Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]]
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
1feb4600c79839ec190dabc5be4f8bfea89c81b2
1624
1499
2012-08-04T21:22:38Z
Tom
4
/* Sample projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]] (Debial Squeeze)
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
414eda904c511d018483c30cc2d94a3e1e8ff86e
1654
1624
2012-08-08T07:53:05Z
Rew
3
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]] (Debial Squeeze)
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
af288923d14a5de31e55192d9e4f86a0a8e3959e
1721
1654
2012-08-20T08:27:25Z
Blackdiamond
1377
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]] (Debial Squeeze)
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
<div style="display:none">
[http://www.pvpoyna.com pvp serverler] [http://www.pvpoyna.com metin2 pvp serverler] [http://www.pvpoyna.com mt2] [http://www.pvpoyna.com mt2 pvp]
</div>
33d15aa7463c533e2a2a42414094023f1ed0093c
1725
1721
2012-08-22T07:12:15Z
Rew
3
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]] (Debial Squeeze)
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
<div style="display:none">
[http://www.pvpoyna.com pvp serverler] [http://www.pvpoyna.com metin2 pvp serverler] [http://www.pvpoyna.com mt2] [http://www.pvpoyna.com mt2 pvp]
</div>
9dd5caf2fe1812452101b12b83e822d9a45b9633
1726
1725
2012-08-24T10:12:16Z
Tom
4
/* Raspberry Pi projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
* [[Beginners guide to SPI on Raspberry Pi]] (Debial Squeeze)
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
<div style="display:none">
[http://www.pvpoyna.com pvp serverler] [http://www.pvpoyna.com metin2 pvp serverler] [http://www.pvpoyna.com mt2] [http://www.pvpoyna.com mt2 pvp]
</div>
13edc56311b15d93a7c42fcf95c03faff22aab86
Reducing power consumption of a raspberry Pi
0
802
1430
2012-06-29T13:33:52Z
Tom
4
Created page with "= Introduction = The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to powe..."
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a $2 switching regulator from ebay. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopepd wasting power, we completely removed it from our Pi, with a hot air gun. To do this, we gripepd the regulator with some metal tweezers, lifted the Pi about a centimeter, and then blasted the regulator with air at 422 degrees Celsius. After a few seconds, the Pi dropped to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup]]
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
f704f70b9349c3f63f226ef929c6515116601e03
1437
1430
2012-06-29T13:57:36Z
Rew
3
/* Slicing the Pi */
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a $2 switching regulator from ebay. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air gun. To do this, we griped the regulator with some metal tweezers, lifted the Pi about a centimeter, and then blasted the regulator with air at 422 degrees Celsius. After a few seconds, the Pi dropped to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup]]
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
1563e677c7a99c37026a8040ea31296a0d7f00c9
1438
1437
2012-06-29T14:49:17Z
Tom
4
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a $2 switching regulator from ebay. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air gun. To do this, we griped the regulator with some metal tweezers, lifted the Pi about a centimeter, and then blasted the regulator with air at 422 degrees Celsius. After a few seconds, the Pi dropped to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
425cb2b8a4e01b8ca56f8a81fe9b6e6ff50020cd
1700
1438
2012-08-14T06:14:45Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [[http://www.bitwizard.nl/catalog/product_info.php?cPath=26&products_id=99|switching regulator from our shop]]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air gun. To do this, we griped the regulator with some metal tweezers, lifted the Pi about a centimeter, and then blasted the regulator with air at 422 degrees Celsius. After a few seconds, the Pi dropped to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
e3cc6764a50778c37ed6a7d6a200bd9dfef38775
1701
1700
2012-08-14T06:16:21Z
Rew
3
/* Slicing the Pi */
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [[http://www.bitwizard.nl/catalog/product_info.php?cPath=26&products_id=99|switching regulator from our shop]]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
0a6944bcfbb154b1224e5c6ce30bbe644e714b5b
File:Switcher.jpg
6
803
1431
2012-06-29T13:34:56Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:No LM1117.jpg
6
804
1432
2012-06-29T13:35:41Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:2regulators.jpg
6
805
1433
2012-06-29T13:35:54Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Benchtop.jpg
6
806
1434
2012-06-29T13:36:04Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Final setup.jpg
6
807
1435
2012-06-29T13:36:17Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
User talk:MinnaLef
3
818
1449
2012-07-06T16:55:34Z
MinnaLef
901
Created page with "There is nothing to tell about myself at all. I enjoy of finally being a part of http://www.bitwizard.nl. I really hope Im useful at all Have a look at my web blog [http:..."
wikitext
text/x-wiki
There is nothing to tell about myself at all.
I enjoy of finally being a part of http://www.bitwizard.nl.
I really hope Im useful at all
Have a look at my web blog [http://airhogreview.com/ air hog]
10f933687b083c1d1e42860385c04489579fc26f
1524
1449
2012-07-19T12:56:02Z
Rew
3
wikitext
text/x-wiki
There is nothing to tell about myself at all.
I enjoy of finally being a part of http://www.bitwizard.nl.
I really hope Im useful at all
Have a look at my web blog
3c742bc5504f4703351fb811c37c91113167c3b9
PiPower
0
836
1468
2012-07-11T12:53:22Z
Tom
4
Created page with "[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]] This is the documentation page for the SPI_PiPower and I2C_PiPower bo..."
wikitext
text/x-wiki
[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]]
This is the documentation page for the SPI_PiPower and I2C_PiPower boards.
== Overview ==
This board enables you to switch upto 4 separete 12V 1A loads, and switch the 5V power rail to the GPIO header of the Paspberry Pi.
== Use cases ==
=== Pipower powered from USB, powers RPi on command ===
Jumper settings: <br>
JP1: 2-3<br>
JP2: nc<br>
=== Pipower powered from RPi. Switches 12V appliances on command ===
Jumper settings:<br>
JP1: 1-2<br>
JP2: nc<br>
=== Pipower powered from 12V on screw connector. Switches a 12V load on command (DCDC converter powering PI) ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 1-2<br>
=== Pipower powered from 5V on screw connector ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 2-3<br>
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
* [http://www.irf.com/product-info/datasheets/data/irlml9301pbf.pdf The P-FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== X1 ===
{| border=1
! pin !! function
|-
| 1 || Vin
|-
| 2 || GND
|}
=== X2 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X3 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X4 ===
{| border=1
! pin !! function
|-
| 1 || Vin1
|-
| 2 || GND
|-
| 3 || Out0
|-
| 4 || GND
|-
| 5 || Out1
|-
| 6 || GND
|}
=== X5 ===
{| border=1
! pin !! function
|-
| 1 || Vin2
|-
| 2 || GND
|-
| 3 || Out2
|-
| 4 || GND
|-
| 5 || Out3
|-
| 6 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
=== Solder Jumper ===
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 into an ICSP programming connector for the attiny44 on the board.
=== Hardware Jumpers ===
JP1: Power source selection<br>
1-2: RPi powered<br>
2-3: USB or X1 powered<br>
JP2: Vin selection<br>
1-2: X1 powered, Vin = 5V<br>
2-3: X1 powered, Vin > 5V<br>
N-C: USB or RPi powered<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[PiPower_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the PiPower board as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
bd88202a6735dc86ca9f64c5defc8d51d03f8474
1500
1468
2012-07-17T10:10:15Z
Rew
3
/* Use cases */
wikitext
text/x-wiki
[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]]
This is the documentation page for the SPI_PiPower and I2C_PiPower boards.
== Overview ==
This board enables you to switch upto 4 separete 12V 1A loads, and switch the 5V power rail to the GPIO header of the Paspberry Pi.
== Use cases ==
Electrically the PiPower has a few modes-of-operation.
=== Pipower powered from USB, powers RPi on command ===
Jumper settings: <br>
JP1: 2-3<br>
JP2: nc<br>
In this configuration you can use your normal USB power supply, and when a time elapses power the 'pi up. Or you can have the pi power up when a signal on the inputs changes.
This is also the easiest way to provide the watchdog function.
=== Pipower powered from RPi. Switches 5-15V appliances on command ===
Jumper settings:<br>
JP1: 1-2<br>
JP2: nc<br>
This is not the original purpose of the PiPower, but a nice extra. The PiPower can switch 1A loads.
=== Pipower powered from 7-15V on screw connector. Switches a load on command (usually DCDC converter powering PI) ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 1-2<br>
This is the configuration best suited for battery power. The PiPower keeps time, and monitors up to two inputs and switches the 'pi on to handle things when either time runs out or one of the inputs becomes active. This way the PiPower can power up your 'Pi for short periods to do "complicated" stuff, while it conserves power for the long times of inactivity.
=== Pipower powered from 5V on screw connector ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 2-3<br>
This is similar to the first item, but now you can use your own DCDC converter. The simplest DCDC converters still use a bit of "idle power", so it might not be as good as the "PiPower directly from the battery" case and having the PiPower turn on the power to the DCDC converter.
On the other hand, if you have a DCDC converter that is efficient at low loads and/or you need the DCDC converter to run anyway because of the other "input signals", then this mode is provided.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
* [http://www.irf.com/product-info/datasheets/data/irlml9301pbf.pdf The P-FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== X1 ===
{| border=1
! pin !! function
|-
| 1 || Vin
|-
| 2 || GND
|}
=== X2 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X3 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X4 ===
{| border=1
! pin !! function
|-
| 1 || Vin1
|-
| 2 || GND
|-
| 3 || Out0
|-
| 4 || GND
|-
| 5 || Out1
|-
| 6 || GND
|}
=== X5 ===
{| border=1
! pin !! function
|-
| 1 || Vin2
|-
| 2 || GND
|-
| 3 || Out2
|-
| 4 || GND
|-
| 5 || Out3
|-
| 6 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
=== Solder Jumper ===
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 into an ICSP programming connector for the attiny44 on the board.
=== Hardware Jumpers ===
JP1: Power source selection<br>
1-2: RPi powered<br>
2-3: USB or X1 powered<br>
JP2: Vin selection<br>
1-2: X1 powered, Vin = 5V<br>
2-3: X1 powered, Vin > 5V<br>
N-C: USB or RPi powered<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[PiPower_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the PiPower board as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
195b92e5d0114358eac52c55ebf07aff9494d2e5
1503
1500
2012-07-17T12:42:54Z
Rew
3
/* X1 */
wikitext
text/x-wiki
[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]]
This is the documentation page for the SPI_PiPower and I2C_PiPower boards.
== Overview ==
This board enables you to switch upto 4 separete 12V 1A loads, and switch the 5V power rail to the GPIO header of the Paspberry Pi.
== Use cases ==
Electrically the PiPower has a few modes-of-operation.
=== Pipower powered from USB, powers RPi on command ===
Jumper settings: <br>
JP1: 2-3<br>
JP2: nc<br>
In this configuration you can use your normal USB power supply, and when a time elapses power the 'pi up. Or you can have the pi power up when a signal on the inputs changes.
This is also the easiest way to provide the watchdog function.
=== Pipower powered from RPi. Switches 5-15V appliances on command ===
Jumper settings:<br>
JP1: 1-2<br>
JP2: nc<br>
This is not the original purpose of the PiPower, but a nice extra. The PiPower can switch 1A loads.
=== Pipower powered from 7-15V on screw connector. Switches a load on command (usually DCDC converter powering PI) ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 1-2<br>
This is the configuration best suited for battery power. The PiPower keeps time, and monitors up to two inputs and switches the 'pi on to handle things when either time runs out or one of the inputs becomes active. This way the PiPower can power up your 'Pi for short periods to do "complicated" stuff, while it conserves power for the long times of inactivity.
=== Pipower powered from 5V on screw connector ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 2-3<br>
This is similar to the first item, but now you can use your own DCDC converter. The simplest DCDC converters still use a bit of "idle power", so it might not be as good as the "PiPower directly from the battery" case and having the PiPower turn on the power to the DCDC converter.
On the other hand, if you have a DCDC converter that is efficient at low loads and/or you need the DCDC converter to run anyway because of the other "input signals", then this mode is provided.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
* [http://www.irf.com/product-info/datasheets/data/irlml9301pbf.pdf The P-FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== X1 ===
Power input. Usually 12V. Do not apply 12V when jumpered for 5V on this connector as it will fry your PiPower.
{| border=1
! pin !! function
|-
| 1 || Vin
|-
| 2 || GND
|}
=== X2 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X3 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X4 ===
{| border=1
! pin !! function
|-
| 1 || Vin1
|-
| 2 || GND
|-
| 3 || Out0
|-
| 4 || GND
|-
| 5 || Out1
|-
| 6 || GND
|}
=== X5 ===
{| border=1
! pin !! function
|-
| 1 || Vin2
|-
| 2 || GND
|-
| 3 || Out2
|-
| 4 || GND
|-
| 5 || Out3
|-
| 6 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
=== Solder Jumper ===
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 into an ICSP programming connector for the attiny44 on the board.
=== Hardware Jumpers ===
JP1: Power source selection<br>
1-2: RPi powered<br>
2-3: USB or X1 powered<br>
JP2: Vin selection<br>
1-2: X1 powered, Vin = 5V<br>
2-3: X1 powered, Vin > 5V<br>
N-C: USB or RPi powered<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[PiPower_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the PiPower board as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
39c860cd9c2f5056c6a4ff3004d09734efa036f0
1504
1503
2012-07-17T12:43:32Z
Rew
3
/* X2 */
wikitext
text/x-wiki
[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]]
This is the documentation page for the SPI_PiPower and I2C_PiPower boards.
== Overview ==
This board enables you to switch upto 4 separete 12V 1A loads, and switch the 5V power rail to the GPIO header of the Paspberry Pi.
== Use cases ==
Electrically the PiPower has a few modes-of-operation.
=== Pipower powered from USB, powers RPi on command ===
Jumper settings: <br>
JP1: 2-3<br>
JP2: nc<br>
In this configuration you can use your normal USB power supply, and when a time elapses power the 'pi up. Or you can have the pi power up when a signal on the inputs changes.
This is also the easiest way to provide the watchdog function.
=== Pipower powered from RPi. Switches 5-15V appliances on command ===
Jumper settings:<br>
JP1: 1-2<br>
JP2: nc<br>
This is not the original purpose of the PiPower, but a nice extra. The PiPower can switch 1A loads.
=== Pipower powered from 7-15V on screw connector. Switches a load on command (usually DCDC converter powering PI) ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 1-2<br>
This is the configuration best suited for battery power. The PiPower keeps time, and monitors up to two inputs and switches the 'pi on to handle things when either time runs out or one of the inputs becomes active. This way the PiPower can power up your 'Pi for short periods to do "complicated" stuff, while it conserves power for the long times of inactivity.
=== Pipower powered from 5V on screw connector ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 2-3<br>
This is similar to the first item, but now you can use your own DCDC converter. The simplest DCDC converters still use a bit of "idle power", so it might not be as good as the "PiPower directly from the battery" case and having the PiPower turn on the power to the DCDC converter.
On the other hand, if you have a DCDC converter that is efficient at low loads and/or you need the DCDC converter to run anyway because of the other "input signals", then this mode is provided.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
* [http://www.irf.com/product-info/datasheets/data/irlml9301pbf.pdf The P-FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== X1 ===
Power input. Usually 12V. Do not apply 12V when jumpered for 5V on this connector as it will fry your PiPower.
{| border=1
! pin !! function
|-
| 1 || Vin
|-
| 2 || GND
|}
=== X2 ===
Opto isolated input. Max 20V.
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X3 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X4 ===
{| border=1
! pin !! function
|-
| 1 || Vin1
|-
| 2 || GND
|-
| 3 || Out0
|-
| 4 || GND
|-
| 5 || Out1
|-
| 6 || GND
|}
=== X5 ===
{| border=1
! pin !! function
|-
| 1 || Vin2
|-
| 2 || GND
|-
| 3 || Out2
|-
| 4 || GND
|-
| 5 || Out3
|-
| 6 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
=== Solder Jumper ===
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 into an ICSP programming connector for the attiny44 on the board.
=== Hardware Jumpers ===
JP1: Power source selection<br>
1-2: RPi powered<br>
2-3: USB or X1 powered<br>
JP2: Vin selection<br>
1-2: X1 powered, Vin = 5V<br>
2-3: X1 powered, Vin > 5V<br>
N-C: USB or RPi powered<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[PiPower_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the PiPower board as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
8a375128b3de9e089891c9080b554b70efc1eead
1505
1504
2012-07-17T12:43:45Z
Rew
3
/* X2 */
wikitext
text/x-wiki
[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]]
This is the documentation page for the SPI_PiPower and I2C_PiPower boards.
== Overview ==
This board enables you to switch upto 4 separete 12V 1A loads, and switch the 5V power rail to the GPIO header of the Paspberry Pi.
== Use cases ==
Electrically the PiPower has a few modes-of-operation.
=== Pipower powered from USB, powers RPi on command ===
Jumper settings: <br>
JP1: 2-3<br>
JP2: nc<br>
In this configuration you can use your normal USB power supply, and when a time elapses power the 'pi up. Or you can have the pi power up when a signal on the inputs changes.
This is also the easiest way to provide the watchdog function.
=== Pipower powered from RPi. Switches 5-15V appliances on command ===
Jumper settings:<br>
JP1: 1-2<br>
JP2: nc<br>
This is not the original purpose of the PiPower, but a nice extra. The PiPower can switch 1A loads.
=== Pipower powered from 7-15V on screw connector. Switches a load on command (usually DCDC converter powering PI) ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 1-2<br>
This is the configuration best suited for battery power. The PiPower keeps time, and monitors up to two inputs and switches the 'pi on to handle things when either time runs out or one of the inputs becomes active. This way the PiPower can power up your 'Pi for short periods to do "complicated" stuff, while it conserves power for the long times of inactivity.
=== Pipower powered from 5V on screw connector ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 2-3<br>
This is similar to the first item, but now you can use your own DCDC converter. The simplest DCDC converters still use a bit of "idle power", so it might not be as good as the "PiPower directly from the battery" case and having the PiPower turn on the power to the DCDC converter.
On the other hand, if you have a DCDC converter that is efficient at low loads and/or you need the DCDC converter to run anyway because of the other "input signals", then this mode is provided.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
* [http://www.irf.com/product-info/datasheets/data/irlml9301pbf.pdf The P-FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== X1 ===
Power input. Usually 12V. Do not apply 12V when jumpered for 5V on this connector as it will fry your PiPower.
{| border=1
! pin !! function
|-
| 1 || Vin
|-
| 2 || GND
|}
=== X2 ===
Opto isolated input 0. Max 20V.
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X3 ===
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X4 ===
{| border=1
! pin !! function
|-
| 1 || Vin1
|-
| 2 || GND
|-
| 3 || Out0
|-
| 4 || GND
|-
| 5 || Out1
|-
| 6 || GND
|}
=== X5 ===
{| border=1
! pin !! function
|-
| 1 || Vin2
|-
| 2 || GND
|-
| 3 || Out2
|-
| 4 || GND
|-
| 5 || Out3
|-
| 6 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
=== Solder Jumper ===
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 into an ICSP programming connector for the attiny44 on the board.
=== Hardware Jumpers ===
JP1: Power source selection<br>
1-2: RPi powered<br>
2-3: USB or X1 powered<br>
JP2: Vin selection<br>
1-2: X1 powered, Vin = 5V<br>
2-3: X1 powered, Vin > 5V<br>
N-C: USB or RPi powered<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[PiPower_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the PiPower board as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
9f11677165d9746627f80ce0da68a05f1365df36
1506
1505
2012-07-17T12:43:53Z
Rew
3
/* X3 */
wikitext
text/x-wiki
[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]]
This is the documentation page for the SPI_PiPower and I2C_PiPower boards.
== Overview ==
This board enables you to switch upto 4 separete 12V 1A loads, and switch the 5V power rail to the GPIO header of the Paspberry Pi.
== Use cases ==
Electrically the PiPower has a few modes-of-operation.
=== Pipower powered from USB, powers RPi on command ===
Jumper settings: <br>
JP1: 2-3<br>
JP2: nc<br>
In this configuration you can use your normal USB power supply, and when a time elapses power the 'pi up. Or you can have the pi power up when a signal on the inputs changes.
This is also the easiest way to provide the watchdog function.
=== Pipower powered from RPi. Switches 5-15V appliances on command ===
Jumper settings:<br>
JP1: 1-2<br>
JP2: nc<br>
This is not the original purpose of the PiPower, but a nice extra. The PiPower can switch 1A loads.
=== Pipower powered from 7-15V on screw connector. Switches a load on command (usually DCDC converter powering PI) ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 1-2<br>
This is the configuration best suited for battery power. The PiPower keeps time, and monitors up to two inputs and switches the 'pi on to handle things when either time runs out or one of the inputs becomes active. This way the PiPower can power up your 'Pi for short periods to do "complicated" stuff, while it conserves power for the long times of inactivity.
=== Pipower powered from 5V on screw connector ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 2-3<br>
This is similar to the first item, but now you can use your own DCDC converter. The simplest DCDC converters still use a bit of "idle power", so it might not be as good as the "PiPower directly from the battery" case and having the PiPower turn on the power to the DCDC converter.
On the other hand, if you have a DCDC converter that is efficient at low loads and/or you need the DCDC converter to run anyway because of the other "input signals", then this mode is provided.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
* [http://www.irf.com/product-info/datasheets/data/irlml9301pbf.pdf The P-FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== X1 ===
Power input. Usually 12V. Do not apply 12V when jumpered for 5V on this connector as it will fry your PiPower.
{| border=1
! pin !! function
|-
| 1 || Vin
|-
| 2 || GND
|}
=== X2 ===
Opto isolated input 0. Max 20V.
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X3 ===
Opto isolated input 1. Max 20V.
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X4 ===
{| border=1
! pin !! function
|-
| 1 || Vin1
|-
| 2 || GND
|-
| 3 || Out0
|-
| 4 || GND
|-
| 5 || Out1
|-
| 6 || GND
|}
=== X5 ===
{| border=1
! pin !! function
|-
| 1 || Vin2
|-
| 2 || GND
|-
| 3 || Out2
|-
| 4 || GND
|-
| 5 || Out3
|-
| 6 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
=== Solder Jumper ===
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 into an ICSP programming connector for the attiny44 on the board.
=== Hardware Jumpers ===
JP1: Power source selection<br>
1-2: RPi powered<br>
2-3: USB or X1 powered<br>
JP2: Vin selection<br>
1-2: X1 powered, Vin = 5V<br>
2-3: X1 powered, Vin > 5V<br>
N-C: USB or RPi powered<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[PiPower_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the PiPower board as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
dbf5a90cf7943f77da7f339d9e0e9ef10b2abdf2
1509
1506
2012-07-17T12:55:31Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_PiPower.jpg|thumb|300px|alt=The PiPower board|The PiPower board (depicted: the SPI version)]]
This is the documentation page for the SPI_PiPower and I2C_PiPower boards.
== Overview ==
This board enables you to switch upto 4 separete 12V 1A loads, and switch the 5V power rail to the GPIO header of the Paspberry Pi.
== Use cases ==
Electrically the PiPower has a few modes-of-operation.
=== Pipower powered from USB, powers RPi on command ===
Jumper settings: <br>
JP1: 2-3<br>
JP2: nc<br>
In this configuration you can use your normal USB power supply, and when a time elapses power the 'pi up. Or you can have the pi power up when a signal on the inputs changes.
This is also the easiest way to provide the watchdog function.
=== Pipower powered from RPi. Switches 5-15V appliances on command ===
Jumper settings:<br>
JP1: 1-2<br>
JP2: nc<br>
This is not the original purpose of the PiPower, but a nice extra. The PiPower can switch 1A loads.
=== Pipower powered from 7-15V on screw connector. Switches a load on command (usually DCDC converter powering PI) ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 1-2<br>
This is the configuration best suited for battery power. The PiPower keeps time, and monitors up to two inputs and switches the 'pi on to handle things when either time runs out or one of the inputs becomes active. This way the PiPower can power up your 'Pi for short periods to do "complicated" stuff, while it conserves power for the long times of inactivity.
=== Pipower powered from 5V on screw connector ===
Jumper settings:<br>
JP1: 2-3<br>
JP2: 2-3<br>
This is similar to the first item, but now you can use your own DCDC converter. The simplest DCDC converters still use a bit of "idle power", so it might not be as good as the "PiPower directly from the battery" case and having the PiPower turn on the power to the DCDC converter.
On the other hand, if you have a DCDC converter that is efficient at low loads and/or you need the DCDC converter to run anyway because of the other "input signals", then this mode is provided.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
* [http://www.irf.com/product-info/datasheets/data/irlml9301pbf.pdf The P-FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== X1 ===
Power input. Usually 12V. Do not apply 12V when jumpered for 5V on this connector as it will fry your PiPower.
{| border=1
! pin !! function
|-
| 1 || Vin
|-
| 2 || GND
|}
=== X2 ===
Opto isolated input 0. Max 20V.
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X3 ===
Opto isolated input 1. Max 20V.
{| border=1
! pin !! function
|-
| 1 || Anode
|-
| 2 || Cathode
|}
=== X4 ===
{| border=1
! pin !! function
|-
| 1 || Vin1
|-
| 2 || GND
|-
| 3 || Out0
|-
| 4 || GND
|-
| 5 || Out1
|-
| 6 || GND
|}
=== X5 ===
{| border=1
! pin !! function
|-
| 1 || Vin2
|-
| 2 || GND
|-
| 3 || Out2
|-
| 4 || GND
|-
| 5 || Out3
|-
| 6 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
=== Solder Jumper ===
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 into an ICSP programming connector for the attiny44 on the board.
=== Hardware Jumpers ===
JP1: Power source selection<br>
1-2: RPi powered<br>
2-3: USB or X1 powered<br>
JP2: Vin selection<br>
1-2: X1 powered, Vin = 5V<br>
2-3: X1 powered, Vin > 5V<br>
N-C: USB or RPi powered<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[PiPower_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the PiPower board as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
883c19177ec05874bbdd6448e9dc374f598adb5f
Default addresses
0
484
1484
1079
2012-07-13T13:00:32Z
Tom
4
wikitext
text/x-wiki
SPI_LCD 0x82<br>
SPI_DIO 0x84<br>
SPI_SERVO 0x86<br>
SPI_7FETs 0x88<br>
SPI_3FETs 0x8A<br>
SPI_TEMP 0x8C (sometimes called SPI_LM35)<br>
SPI_RELAY 0x8E<br>
SPI_motor 0x90<br>
SPI_pipower 0x92<br>
fcda7b6499c1fcb9b5c5c9b03508b5a644c184c9
PiPower protocol
0
863
1501
2012-07-17T10:54:56Z
Rew
3
Created page with "= PiPower protocol = The premise is that in general the PiPower will turn the raspberry pi ON in certain conditions, and that the Raspberry Pi will tell the PiPower to turn i..."
wikitext
text/x-wiki
= PiPower protocol =
The premise is that in general the PiPower will turn the raspberry pi ON in certain conditions, and that the Raspberry Pi will tell the PiPower to turn it off when it's ready for that.
Besides that, there is the "watchdog" mode, where after a period of inactivity from the 'Pi the PiPower will powercycle the Raspberry Pi.
== registers ==
=== watchdog functions ===
The watchdog registers are saved to eeprom, so they will function again after a powerloss.
* watchdog.
A write to this register resets the watchdog.
* Watchdog interval.
After this time without any writes to the watchdog the PiPower will initiate the watchdog cycle. You should attempt to write at least twice this rate to the watchdog register. As Linux is not real-time, you should take some margin and not set this value too short. Disable the watchdog function by writing this
* Watchdog leniency. // Find a better word.
This is the time after power on due to the watchdog that the watchdog function will not yet function. This allows the raspberry pi to boot.
* Watchdog offtime
When the watchdog activates, this is the time that the raspberry pi is turned off. We recommend setting this at 1 second. If you make it too short the power-on-reset might not activate, requiring multiple watchdog cycles before your 'pi will boot again.
=== turning the 'pi off ===
* timed_turn_off
Set this register to the time until a poweroff is required. Write zero for an immediate turn-off.
* More?
=== turning the 'pi on ===
* timed turn on
Turn on an output after a specified time delay. This can be used to turn the 'pi back on after a specified time, as you can issue a turn-off command after this one. Write zero for an immediate turn-on.
* Input configuration.
Writing a 1 bit will turn on the pi for that event. An event is defined as a change of the input values. The input values after the change form a binary word. The binary word indexes into this byte. So the lowest order bit specifies what to do when the inputs change to 00: a 0 means: do nothing, a 1 means: turn on the 'pi. The 'pi should determine how/when to turn itself off again.
=== event log ===
* event log.
A read of this register will return events from the event log. The first byte indicates the event type. A timestamp follows.
* Events to be logged.
each bit specifies one type of events that can be logged. 1 means: Add to log. 0 means do not add to log.
events that can be logged are:
** pi turn on
** pi turn off
** input changed
** watchdog triggered
** more?
=== inputs ===
* input
a read of this register reads the inputs. This can be used to poll the inputs while the 'pi is on.
05ce027bc25a7b26f07ba856fc747d781612752c
1502
1501
2012-07-17T11:04:14Z
Rew
3
/* PiPower protocol */
wikitext
text/x-wiki
= PiPower protocol =
The premise is that in general the PiPower will turn the raspberry pi ON in certain conditions, and that the Raspberry Pi will tell the PiPower to turn it off when it's ready for that.
Besides that, there is the "watchdog" mode, where after a period of inactivity from the 'Pi the PiPower will powercycle the Raspberry Pi.
Times are specified in miliseconds. Time measurements are not accurate. So if your 'pi needs to be powered on after one hour, you'll have to take some margin. Officially the accuracy is +/- 10%. If you want, you can measure the timer drift and compensate for it with the timer adjustment. This should give you 1% accuracy, provided the temperature and powersupply voltage do not change.
== registers ==
=== watchdog functions ===
The watchdog registers are saved to eeprom, so they will function again after a powerloss.
* watchdog.
A write to this register resets the watchdog.
* Watchdog interval.
After this time without any writes to the watchdog the PiPower will initiate the watchdog cycle. You should attempt to write at least twice this rate to the watchdog register. As Linux is not real-time, you should take some margin and not set this value too short. Disable the watchdog function by writing this
* Watchdog leniency. // Find a better word.
This is the time after power on due to the watchdog that the watchdog function will not yet function. This allows the raspberry pi to boot.
* Watchdog offtime
When the watchdog activates, this is the time that the raspberry pi is turned off. We recommend setting this at 1 second. If you make it too short the power-on-reset might not activate, requiring multiple watchdog cycles before your 'pi will boot again.
=== turning the 'pi off ===
* timed_turn_off
Set this register to the time until a poweroff is required. Write zero for an immediate turn-off.
* More?
=== turning the 'pi on ===
* timed turn on
Turn on an output after a specified time delay. This can be used to turn the 'pi back on after a specified time, as you can issue a turn-off command after this one. Write zero for an immediate turn-on.
* Input configuration.
Writing a 1 bit will turn on the pi for that event. An event is defined as a change of the input values. The input values after the change form a binary word. The binary word indexes into this byte. So the lowest order bit specifies what to do when the inputs change to 00: a 0 means: do nothing, a 1 means: turn on the 'pi. The 'pi should determine how/when to turn itself off again.
=== event log ===
* event log.
A read of this register will return events from the event log. The first byte indicates the event type. A timestamp follows.
* Events to be logged.
each bit specifies one type of events that can be logged. 1 means: Add to log. 0 means do not add to log.
events that can be logged are:
** pi turn on
** pi turn off
** input changed
** watchdog triggered
** more?
=== inputs ===
* input
a read of this register reads the inputs. This can be used to poll the inputs while the 'pi is on.
=== timer ===
* Timer adjustment.
This is the parts-per-million that adjusts the time. (signed value). Saved to eeprom.
9412f9503a416832d0a6046a9339caab8a014d05
3FETs
0
483
1507
1210
2012-07-17T12:54:13Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software | the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
243a9768e7bb9cc6695df010ad360fc9afa12047
1508
1507
2012-07-17T12:54:30Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
958a523dd459e2f0afa5db6380311134fe64b6ec
Temperature Interface
0
51
1510
1246
2012-07-17T12:56:11Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
1d3e4a228537f4798da6993a2d2aea533b34958e
Beginners guide to SPI on Raspberry Pi
0
794
1543
1420
2012-07-21T14:42:52Z
David
17
/* Next steps */ typfoutje
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip Debian image for Raspberry Pi]
* [http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz Modified kernel and modules]
* [http://www.bitwizard.nl/software/bw_lcd.c bw_lcd program]
Unpack the first two packages, I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, en plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (75MB) partition (mounted as /media/95F5-0D7A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.6GB) partition, containing all other data (mounted as /media/18c27e44-ad29-4264-9506-c93bb7083f47 on my system). You may need to change the target directory in the following commands.
Copy the relevant data:
cp rpi-spi-binary-kernel-20120608/boot/* /media/95F5-0D7A/
sudo rsync -aPv rpi-spi-binary-kernel-20120608/lib/ /media/18c27e44-ad29-4264-9506-c93bb7083f47/lib/
cp bw_lcd.c /media/18c27e44-ad29-4264-9506-c93bb7083f47/home/pi/
Enable ssh on your pi:
mv /media/95F5-0D7A/boot_enable_ssh.rc /media/95F5-0D7A/boot.rc
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/
And remove the SD card from your reader.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and wait... If you haven't connected a monitor, you can remove power to your Pi after 2 minutes, and reconnect it. If you do have a monitor attached, you can power cycle your pi if "Stopping portmap daemon..." takes more than 5 seconds.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Now we need to compile the bw_lcd.c program:
gcc -o bw_lcd bw_lcd.c
And now, it's time to play! Let's try to display our first text:
sudo ./bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem below. We will respond as soon as we can, and post the problems and solutions on this page.
6aa3461c58e696d3eafdc3825f04787371316894
Servo
0
50
1568
1195
2012-07-25T09:57:48Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
for the I2C connector see: [[I2C_connector_pinout]]
The pinout is standard for servo-motors;
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || Servo || PWM data.
|-
|}
Besides the seven servo outputs, there is an eight header:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || - || No pin
|-
|}
This can be used to provide power to the servos. For example, mosts ESCs have a BEC on board. These would fit on this connector, leaving the PWM signal pin unconnected.
=== LEDs ===
The only LED is a power-LED.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
b3c09275491956277e6ebc31c461d149e04c60f6
User talk:Electric Bob
3
985
1642
2012-08-07T22:32:52Z
Electric Bob
1169
LCD to RPI 4pin verse 6pin
wikitext
text/x-wiki
Today for my Raspberry PI I received
RPI_SERIAL
4Pin Cable
I2C_LCD
The SPI_LCD module has two 4 pin connectors (in & out), I do not know the pin-out of these. The 4pin cable does not match the 6 pin header on the RPI_SERIAL Board's SPI0 connection. How do these boards interconnect? Does this LCD require 5v or 3.3v?
0d987d8d9ae69acc1c84796514ebcf706ec83a6b
1651
1642
2012-08-08T07:03:16Z
Electric Bob
1169
SPI Verse I2C connectors
wikitext
text/x-wiki
Today for my Raspberry PI I received
RPI_SERIAL
4Pin Cable
I2C_LCD
The SPI_LCD module has two 4 pin connectors (in & out), I do not know the pin-out of these. The 4pin cable does not match the 6 pin header on the RPI_SERIAL Board's SPI0 connection. How do these boards interconnect? Does this LCD require 5v or 3.3v?
OK, I see my mistake: the LCD connector has a 4-pin connector for I2C, the SPI0 pins are not present, I'll need to install them and add the jumper for SPI.
85ddf12f22168a6c9f2bc0c767174caa5f61974d
1652
1651
2012-08-08T07:43:18Z
Rew
3
wikitext
text/x-wiki
Today for my Raspberry PI I received
RPI_SERIAL
4Pin Cable
I2C_LCD
The SPI_LCD module has two 4 pin connectors (in & out), I do not know the pin-out of these. The 4pin cable does not match the 6 pin header on the RPI_SERIAL Board's SPI0 connection. How do these boards interconnect? Does this LCD require 5v or 3.3v?
OK, I see my mistake: the LCD connector has a 4-pin connector for I2C, the SPI0 pins are not present, I'll need to install them and add the jumper for SPI.
-> No, Bob, You have an I2C-LCD board. Adding the SPI connector will not convert it to the SPI version. we currently flash the controller on the board for the version that you order. We're contemplating if we can make the software auto-detect I2C or SPI. The LCD itself requires 5V. -- REW
d86cb892171c4022262ec1d929694e080911d36a
Raspberry Pi Serial
0
59
1689
1327
2012-08-12T11:46:36Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools . XXX figure out where they are.
You can send things from your 'pi to the I2C and SPI busses using the tools from:
http://www.bitwizard.nl/software/gpio_spi_i2c_20120419.tgz
== getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== changelog ===
* Initial public release
1dfec94f5764f778a1e7c5aa326f09eed130630e
1702
1689
2012-08-14T07:24:59Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 28 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools .
git clone https://github.com/rewolff/bw_rpi_tools.git
Now, you can use the tools in either the SPI or I2C subdirectory to communicate with bitwizard SPI or I2C boards that you might have.
== getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== changelog ===
* Initial public release
0f3cfb4adfe78ac204b514148108d69dec3f084e
LCD
0
716
1703
1416
2012-08-14T09:01:57Z
Rew
3
/* The software */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
18d52bcffc3218e9f7b18a34df158226ce016edf
Getting started with rpi serial and BitWizard expansion boards
0
1039
1704
2012-08-14T09:07:37Z
Rew
3
Created page with "= Getting started with rpi serial and BitWizard expansion boards = Each of the following needs to be expanded. Please add a line or two if you can. * get raspian * comment ..."
wikitext
text/x-wiki
= Getting started with rpi serial and BitWizard expansion boards =
Each of the following needs to be expanded. Please add a line or two if you can.
* get raspian
* comment out the two lines in /etc/modprobe.d/raspi-blacklist.conf
* get bw_rpi_tools
* compile bw_rpi_tools
* get rpi-update
* run rpi-update
* reboot
* for the spi version, run
sudo bw_rpi_tools/bw_spi/bw_lcd -t "hello world"
* for the i2c version run
sudo bw_rpi_tools/bw_i2c_lcd/bw_i2c_lcd -t "hello world"
(the sample assumes the LCD and displays a text on it. )
c5391ec6913c9e61f37503e2cf7eebdeca99815a
1705
1704
2012-08-14T10:49:40Z
Rew
3
wikitext
text/x-wiki
= Getting started with rpi serial and BitWizard expansion boards =
Each of the following needs to be expanded. Please add a line or two if you can.
* get raspian
* comment out the two lines in /etc/modprobe.d/raspi-blacklist.conf
* get bw_rpi_tools
* compile bw_rpi_tools
* get rpi-update
* run rpi-update
* reboot
* for the spi version, run
sudo bw_rpi_tools/bw_spi/bw_lcd -t "hello world"
* for the i2c version run
sudo modprobe i2c-dev
sudo bw_rpi_tools/bw_i2c_lcd/bw_i2c_lcd -t "hello world"
(the sample assumes the LCD and displays a text on it. )
19105fbe64189a0e53d72ea8f2239d931258b37e
1706
1705
2012-08-14T10:50:01Z
Rew
3
/* Getting started with rpi serial and BitWizard expansion boards */
wikitext
text/x-wiki
Each of the following needs to be expanded. Please add a line or two if you can.
* get raspian
* comment out the two lines in /etc/modprobe.d/raspi-blacklist.conf
* get bw_rpi_tools
* compile bw_rpi_tools
* get rpi-update
* run rpi-update
* reboot
* for the spi version, run
sudo bw_rpi_tools/bw_spi/bw_lcd -t "hello world"
* for the i2c version run
sudo modprobe i2c-dev
sudo bw_rpi_tools/bw_i2c_lcd/bw_i2c_lcd -t "hello world"
(the sample assumes the LCD and displays a text on it. )
3e6e2f86f60cb7370ebffeeac717977dc2ad23a1
File:I2c connection.jpg
6
1040
1707
2012-08-14T15:46:13Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
I2C connector pinout
0
619
1708
1135
2012-08-14T15:47:10Z
Rew
3
/* Connecting the BitWizard boards to an Arduino */
wikitext
text/x-wiki
For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable.
The connector is laid out as follows:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || SDA || Serial I2C Data
|-
| 3 || SCK || Serial I2C Clock
|-
| 4 || VCC || Power 5V.
|-
|}
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || SDA || A4 (Analog input 4) || Digital 20
|-
| 3 || SCK || A5 (analog input 5) || Digital 21
|-
| 4 || VCC || VCC || VCC
|-
|}
You could use other pins, but then you have to make a software I2C implementation. This is not too difficult, but might be neccesary if something else is already on the I2C pins.
== example connection to rpi_serial ==
8b615674d507f3f3d072440f46133c8362d7766c
1709
1708
2012-08-14T15:49:56Z
Rew
3
/* example connection to rpi_serial */
wikitext
text/x-wiki
For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable.
The connector is laid out as follows:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || SDA || Serial I2C Data
|-
| 3 || SCK || Serial I2C Clock
|-
| 4 || VCC || Power 5V.
|-
|}
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || SDA || A4 (Analog input 4) || Digital 20
|-
| 3 || SCK || A5 (analog input 5) || Digital 21
|-
| 4 || VCC || VCC || VCC
|-
|}
You could use other pins, but then you have to make a software I2C implementation. This is not too difficult, but might be neccesary if something else is already on the I2C pins.
== example connection to rpi_serial ==
[[File:i2c_connection.jpg|none|thumb|600px|alt=i2c connection to RPi_serial|i2c_lcd connected to rpi_serial]]
dd90e5fc9a00b4e3a2b2d45750f778e38d6d3be0
Main Page
0
1
1727
1726
2012-08-24T10:15:06Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze")
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
<div style="display:none">
[http://www.pvpoyna.com pvp serverler] [http://www.pvpoyna.com metin2 pvp serverler] [http://www.pvpoyna.com mt2] [http://www.pvpoyna.com mt2 pvp]
</div>
9f5be59f6d9efdad5250edba045db4ed1f63c1f4
1731
1727
2012-08-24T10:40:03Z
Tom
4
/* How-to's */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
<div style="display:none">
[http://www.pvpoyna.com pvp serverler] [http://www.pvpoyna.com metin2 pvp serverler] [http://www.pvpoyna.com mt2] [http://www.pvpoyna.com mt2 pvp]
</div>
8eeb44bcd41e632b0f781c05394b7ca8f2eceb82
1745
1731
2012-09-03T16:01:24Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
d3bec3eb712c3bb5f4ff5ceb7cb286796cd6c983
1835
1745
2012-10-01T09:59:10Z
Tom
4
/* Raspberry Pi projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
25c8d1a6fe0f5ba24a6baa3720dec7f897abf939
1913
1835
2012-10-10T13:13:36Z
Tom
4
/* Raspberry Pi projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
2961f114dcef859381ddfd6740793c881539090e
1916
1913
2012-10-10T13:27:41Z
Tom
4
/* Raspberry Pi projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
b15ad17dd0179a47738e88b4925ec87623df6689
2272
1916
2012-11-16T14:00:42Z
Tom
4
/* General pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
27e201b438c5d708431c94616f8a8ddc04771514
Beginners guide to SPI on Raspberry Pi
0
794
1728
1543
2012-08-24T10:22:03Z
Tom
4
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip Debian image for Raspberry Pi]
* [http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz Modified kernel and modules]
* [http://www.bitwizard.nl/software/bw_lcd.c bw_lcd program]
Unpack the first two packages, I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, and plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (75MB) partition (mounted as /media/95F5-0D7A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.6GB) partition, containing all other data (mounted as /media/18c27e44-ad29-4264-9506-c93bb7083f47 on my system). You may need to change the target directory in the following commands.
Copy the relevant data:
cp rpi-spi-binary-kernel-20120608/boot/* /media/95F5-0D7A/
sudo rsync -aPv rpi-spi-binary-kernel-20120608/lib/ /media/18c27e44-ad29-4264-9506-c93bb7083f47/lib/
cp bw_lcd.c /media/18c27e44-ad29-4264-9506-c93bb7083f47/home/pi/
Enable ssh on your pi:
mv /media/95F5-0D7A/boot_enable_ssh.rc /media/95F5-0D7A/boot.rc
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/
And remove the SD card from your reader.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and wait... If you haven't connected a monitor, you can remove power to your Pi after 2 minutes, and reconnect it. If you do have a monitor attached, you can power cycle your pi if "Stopping portmap daemon..." takes more than 5 seconds.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Now we need to compile the bw_lcd.c program:
gcc -o bw_lcd bw_lcd.c
And now, it's time to play! Let's try to display our first text:
sudo ./bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem below. We will respond as soon as we can, and post the problems and solutions on this page.
3f4a0c94304a71efb411d6fd4081e4595198f855
1729
1728
2012-08-24T10:23:18Z
Tom
4
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card. The instructions are written for a Linux system, but most instructions also apply for Windows systems.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/debian/6/debian6-19-04-2012/debian6-19-04-2012.zip Debian image for Raspberry Pi]
* [http://www.bitwizard.nl/software/rpi-spi-binary-kernel-20120608.tgz Modified kernel and modules]
* [http://www.bitwizard.nl/software/bw_lcd.c bw_lcd program]
Unpack the first two packages, I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, and plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (75MB) partition (mounted as /media/95F5-0D7A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.6GB) partition, containing all other data (mounted as /media/18c27e44-ad29-4264-9506-c93bb7083f47 on my system). You may need to change the target directory in the following commands.
Copy the relevant data:
cp rpi-spi-binary-kernel-20120608/boot/* /media/95F5-0D7A/
sudo rsync -aPv rpi-spi-binary-kernel-20120608/lib/ /media/18c27e44-ad29-4264-9506-c93bb7083f47/lib/
cp bw_lcd.c /media/18c27e44-ad29-4264-9506-c93bb7083f47/home/pi/
Enable ssh on your pi:
mv /media/95F5-0D7A/boot_enable_ssh.rc /media/95F5-0D7A/boot.rc
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/
And remove the SD card from your reader.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and wait... If you haven't connected a monitor, you can remove power to your Pi after 2 minutes, and reconnect it. If you do have a monitor attached, you can power cycle your pi if "Stopping portmap daemon..." takes more than 5 seconds.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Now we need to compile the bw_lcd.c program:
gcc -o bw_lcd bw_lcd.c
And now, it's time to play! Let's try to display our first text:
sudo ./bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem below. We will respond as soon as we can, and post the problems and solutions on this page.
3ca46eff01d0664afc7f10723b67eb4d07ad1557
RPi SPI wheezy
0
1055
1730
2012-08-24T10:38:30Z
Tom
4
Created page with "= Introduction = In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank..."
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/raspbian/2012-08-16-wheezy-raspbian/2012-08-16-wheezy-raspbian.zip Raspbian "wheezy" image for Raspberry Pi, with hardware floating point support]
* [http://www.bitwizard.nl/software/bw_upgrade Script to enable SPI and I2C, and to update your Pi's software]
Unpack the Raspbian image, and download the script. I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, and plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (56MB) partition (mounted as /media/1AF7-904A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.7GB) partition, containing all other data (mounted as /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0 on my system). You may need to change the target directory in the following commands.
Copy the relevant script:
cp bw_upgrade /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/
Make sure the script is executable:
chmod 755 /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/bw_upgrade
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0
sudo umount /media/1AF7-904A
And remove the SD card from your reader.
== Under Windows ==
Will be written ASAP.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo ./bw_rpi_tools/bw_spi/bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
Note: We have written a new program, bw_tool, which is also capable of controlling our SPI boards. However, we still need to write the documentation for it. The program and sources are located in ~/bw_rpi_tools/bw_tool .
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
55950a4133f9e9f28da5255e184ab5a4d4666234
1751
1730
2012-09-04T09:28:28Z
Rew
3
/* First boot */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/raspbian/2012-08-16-wheezy-raspbian/2012-08-16-wheezy-raspbian.zip Raspbian "wheezy" image for Raspberry Pi, with hardware floating point support]
* [http://www.bitwizard.nl/software/bw_upgrade Script to enable SPI and I2C, and to update your Pi's software]
Unpack the Raspbian image, and download the script. I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, and plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (56MB) partition (mounted as /media/1AF7-904A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.7GB) partition, containing all other data (mounted as /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0 on my system). You may need to change the target directory in the following commands.
Copy the relevant script:
cp bw_upgrade /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/
Make sure the script is executable:
chmod 755 /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/bw_upgrade
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0
sudo umount /media/1AF7-904A
And remove the SD card from your reader.
== Under Windows ==
Will be written ASAP.
= connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the raspberry pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the raspberry pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to raspberry pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo ./bw_rpi_tools/bw_spi/bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [Raspberry_Pi_LCD_program manual] for other options.
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
Note: We have written a new program, bw_tool, which is also capable of controlling our SPI boards. However, we still need to write the documentation for it. The program and sources are located in ~/bw_rpi_tools/bw_tool .
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
907d8b3e8b1e5caf6de1dca2a9977642ca85a24e
1820
1751
2012-09-26T13:39:47Z
Tom
4
/* Playing time */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/raspbian/2012-08-16-wheezy-raspbian/2012-08-16-wheezy-raspbian.zip Raspbian "wheezy" image for Raspberry Pi, with hardware floating point support]
* [http://www.bitwizard.nl/software/bw_upgrade Script to enable SPI and I2C, and to update your Pi's software]
Unpack the Raspbian image, and download the script. I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, and plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (56MB) partition (mounted as /media/1AF7-904A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.7GB) partition, containing all other data (mounted as /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0 on my system). You may need to change the target directory in the following commands.
Copy the relevant script:
cp bw_upgrade /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/
Make sure the script is executable:
chmod 755 /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/bw_upgrade
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0
sudo umount /media/1AF7-904A
And remove the SD card from your reader.
== Under Windows ==
Will be written ASAP.
= connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the raspberry pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the raspberry pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to raspberry pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo ./bw_rpi_tools/bw_spi/bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [[Raspberry_Pi_LCD_program]] manual for other options.
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
Note: We have written a new program, bw_tool, which is also capable of controlling our SPI boards. However, we still need to write the documentation for it. The program and sources are located in ~/bw_rpi_tools/bw_tool .
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
7e51b1af49e8e61fcbc497601576acaa62fdea45
Default addresses
0
484
1744
1484
2012-09-03T13:41:40Z
Tom
4
wikitext
text/x-wiki
SPI_LCD 0x82<br>
SPI_DIO 0x84<br>
SPI_SERVO 0x86<br>
SPI_7FETs 0x88<br>
SPI_3FETs 0x8A<br>
SPI_TEMP 0x8C (sometimes called SPI_LM35)<br>
SPI_RELAY 0x8E<br>
SPI_motor 0x90<br>
SPI_pipower 0x92<br>
RPi_UI 0x94<br>
234331dbdaef6410571a21bfc8bd306be54d203c
2032
1744
2012-10-19T12:41:27Z
Tom
4
wikitext
text/x-wiki
tw_LCD 0x82<br>
tw_DIO 0x84<br>
tw_SERVO 0x86<br>
tw_7FETs 0x88<br>
tw_3FETs 0x8A<br>
tw_TEMP 0x8C (sometimes called SPI_LM35)<br>
tw_RELAY 0x8E<br>
tw_motor 0x90<br>
tw_pipower 0x92<br>
RPi_UI 0x94<br>
tw_7segment 0x96
904f3076953ff5f0e3948f42bb77c6955f8b18a8
2240
2032
2012-11-05T16:35:51Z
Rew
3
wikitext
text/x-wiki
tw_LCD 0x82<br>
tw_DIO 0x84<br>
tw_SERVO 0x86<br>
tw_7FETs 0x88<br>
tw_3FETs 0x8A<br>
tw_TEMP 0x8C (sometimes called SPI_LM35)<br>
tw_RELAY 0x8E<br>
tw_motor 0x90<br>
tw_pipower 0x92<br>
RPi_UI 0x94<br>
tw_7segment 0x96<br>
spi_spi 0x98<br>
7ce86c455523352eddc3dfc74ffff066bf26ae63
2241
2240
2012-11-05T16:36:09Z
Rew
3
wikitext
text/x-wiki
tw_LCD 0x82<br>
tw_DIO 0x84<br>
tw_SERVO 0x86<br>
tw_7FETs 0x88<br>
tw_3FETs 0x8A<br>
tw_TEMP 0x8C (sometimes called SPI_LM35)<br>
tw_RELAY 0x8E<br>
tw_motor 0x90<br>
tw_pipower 0x92<br>
RPi_UI 0x94<br>
tw_7segment 0x96<br>
spi_spi 0x98<br>
fe8b87fefadfc100d19ecab4d2b444a81579548c
2255
2241
2012-11-07T15:30:35Z
Tom
4
wikitext
text/x-wiki
tw_LCD 0x82<br>
tw_DIO 0x84<br>
tw_SERVO 0x86<br>
tw_7FETs 0x88<br>
tw_3FETs 0x8A<br>
tw_TEMP 0x8C (sometimes called SPI_LM35)<br>
tw_RELAY 0x8E<br>
tw_motor 0x90<br>
tw_pipower 0x92<br>
RPi_UI 0x94<br>
tw_7segment 0x96<br>
spi_spi 0x98<br>
tw_pushbutton 0x9a<br>
98a18b07a7d8c175137979e3a4a85bb558ec9b87
2264
2255
2012-11-12T16:41:13Z
Tom
4
wikitext
text/x-wiki
{| border=1
! Board !! Address
|-
| tw_LCD || 0x82
|-
| tw_DIO || 0x84
|-
| tw_SERVO || 0x86
|-
| tw_7FETs || 0x88
|-
| tw_3FETs || 0x8A
|-
| tw_TEMP (sometimes called SPI_LM35) || 0x8C
|-
| tw_RELAY || 0x8E
|-
| tw_motor || 0x90
|-
| tw_pipower || 0x92
|-
| RPi_UI || 0x94
|-
| tw_7segment || 0x96
|-
| spi_spi || 0x98
|-
| tw_pushbutton || 0x9a
|}
cb3fc96ef466a164c38b3422533c92a681fce999
Spi lcd 1.3 protocol
0
112
1746
777
2012-09-03T22:05:47Z
Rew
3
/* write ports */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
f6a04d80cbc2a851f97c668f8a37cb491854ee1a
LCD
0
716
1749
1703
2012-09-04T07:03:55Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
85cbea192c895c2c2194cea34bbc7ec98426cb9d
1757
1749
2012-09-05T09:22:41Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
aa13f23aa3f16b5733eed55d552b179b38d13047
File:DSC04800.JPG
6
1075
1756
2012-09-05T09:16:59Z
Rew
3
Connecting an I2C board without rpi_serial.
wikitext
text/x-wiki
Connecting an I2C board without rpi_serial.
de5b563a1d86794e0ae85c81a57451e672972d35
DIO protocol
0
432
1758
1422
2012-09-05T09:58:54Z
Rew
3
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Set PWM value for output 0 (only works on dio software version 1.1 and higher)
|-
| 0x51 || Set PWM value for output 1 (only works on dio software version 1.1 and higher)
|-
| 0x52 || Set PWM value for output 2 (only works on dio software version 1.1 and higher)
|-
| 0x53 || Set PWM value for output 3 (only works on dio software version 1.1 and higher)
|-
| 0x54 || Set PWM value for output 4 (only works on dio software version 1.1 and higher)
|-
| 0x55 || Set PWM value for output 5 (only works on dio software version 1.1 and higher)
|-
| 0x56 || Set PWM value for output 6 (only works on dio software version 1.1 and higher)
|-
| 0x5f || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Return PWM value for output 0 (only works on dio software version 1.1 and higher)
|-
| 0x51 || Return PWM value for output 1 (only works on dio software version 1.1 and higher)
|-
| 0x52 || Return PWM value for output 2 (only works on dio software version 1.1 and higher)
|-
| 0x53 || Return PWM value for output 3 (only works on dio software version 1.1 and higher)
|-
| 0x54 || Return PWM value for output 4 (only works on dio software version 1.1 and higher)
|-
| 0x55 || Return PWM value for output 5 (only works on dio software version 1.1 and higher)
|-
| 0x56 || Return PWM value for output 6 (only works on dio software version 1.1 and higher)
|-
| 0x5f || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
bd53b62bb7de90df8c81cc53cbcc55a975c211fb
1759
1758
2012-09-05T10:06:11Z
Rew
3
/* read identification */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Set PWM value for output 0 (only works on dio software version 1.1 and higher)
|-
| 0x51 || Set PWM value for output 1 (only works on dio software version 1.1 and higher)
|-
| 0x52 || Set PWM value for output 2 (only works on dio software version 1.1 and higher)
|-
| 0x53 || Set PWM value for output 3 (only works on dio software version 1.1 and higher)
|-
| 0x54 || Set PWM value for output 4 (only works on dio software version 1.1 and higher)
|-
| 0x55 || Set PWM value for output 5 (only works on dio software version 1.1 and higher)
|-
| 0x56 || Set PWM value for output 6 (only works on dio software version 1.1 and higher)
|-
| 0x5f || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Return PWM value for output 0 (only works on dio software version 1.1 and higher)
|-
| 0x51 || Return PWM value for output 1 (only works on dio software version 1.1 and higher)
|-
| 0x52 || Return PWM value for output 2 (only works on dio software version 1.1 and higher)
|-
| 0x53 || Return PWM value for output 3 (only works on dio software version 1.1 and higher)
|-
| 0x54 || Return PWM value for output 4 (only works on dio software version 1.1 and higher)
|-
| 0x55 || Return PWM value for output 5 (only works on dio software version 1.1 and higher)
|-
| 0x56 || Return PWM value for output 6 (only works on dio software version 1.1 and higher)
|-
| 0x5f || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
4648a89663d55ebb9bfdc7735eb240d273fe4988
1772
1759
2012-09-06T14:27:14Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
! port !! function
|-
| 0x10 || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || set current position. (only DIOand 7FETS)
|-
| 0x41 || set target position. (only DIO and 7FETS)
|-
| 0x42 || set relative position. (only DIO and 7FETS)
|-
| 0x43 || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 .. 0x57 || Set PWM value. 0x50: output 0, 0x51 output 1 etc. (implemented in dio version 1.1)
|-
| 0x5f || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only works on dio software version 1.1 and higher)
|-
| 0xf0 || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Return PWM value for output 0 (only works on dio software version 1.1 and higher)
|-
| 0x51 || Return PWM value for output 1 (only works on dio software version 1.1 and higher)
|-
| 0x52 || Return PWM value for output 2 (only works on dio software version 1.1 and higher)
|-
| 0x53 || Return PWM value for output 3 (only works on dio software version 1.1 and higher)
|-
| 0x54 || Return PWM value for output 4 (only works on dio software version 1.1 and higher)
|-
| 0x55 || Return PWM value for output 5 (only works on dio software version 1.1 and higher)
|-
| 0x56 || Return PWM value for output 6 (only works on dio software version 1.1 and higher)
|-
| 0x5f || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
5192520a9cb477c79ae1d46e68acde5fb5685dac
2261
1772
2012-11-12T16:34:22Z
Tom
4
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all inputs
|-
| 0x20 .. 0x27 || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || read current position. (only DIO and 7FETS)
|-
| 0x41 || read target position. (only DIO and 7FETS)
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (only DIO and 7FETS)
|-
| 0x50 || Return PWM value for output 0 (only works on dio software version 1.1 and higher)
|-
| 0x51 || Return PWM value for output 1 (only works on dio software version 1.1 and higher)
|-
| 0x52 || Return PWM value for output 2 (only works on dio software version 1.1 and higher)
|-
| 0x53 || Return PWM value for output 3 (only works on dio software version 1.1 and higher)
|-
| 0x54 || Return PWM value for output 4 (only works on dio software version 1.1 and higher)
|-
| 0x55 || Return PWM value for output 5 (only works on dio software version 1.1 and higher)
|-
| 0x56 || Return PWM value for output 6 (only works on dio software version 1.1 and higher)
|-
| 0x5f || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0 (only workson dio software version 1.1 and higher)
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
705d58493399e90803db3685de0994fc3b631f82
2262
2261
2012-11-12T16:37:22Z
Tom
4
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs and FETs will be explained on this page. Most functions apply to all three boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the DIO board is 0x84.
The default address of the 7FETS board is 0x88.
The default address of the 3FETS board is 0x8A.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
b3d45ab218d3f78df85a4a9b0671af047bbde10b
2263
2262
2012-11-12T16:39:02Z
Tom
4
/* Introduction */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
a28da00399914e4ac5f8dabed0258c76419308c4
2265
2263
2012-11-12T17:54:32Z
Tom
4
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated samples
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
86d36c34036478c02324675f0c97c69472c2998b
2266
2265
2012-11-12T18:05:08Z
Tom
4
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (use a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return avaraged analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (use a power of 2) (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
Will be addad ASAP (nov. 12 2012)
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
744d546ace113d0eb3c863ff7259639dec710b28
2267
2266
2012-11-12T18:12:41Z
Tom
4
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (use a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return avaraged analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
Will be addad ASAP (nov. 12 2012)
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
be9e9d49f249c079807df6c6ee95a8dc39758d0b
2268
2267
2012-11-12T18:23:30Z
Tom
4
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
Will be completed ASAP (nov. 12 2012) <br>
<br>
The built-in ADC has 10 bits of resolution, and can be used in different ways:<br>
* Just read one single sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but very prone to noise. The second option gives you the ability to filter out the noise, and/or avarage a number of samples.<br>
To take the avarage of a number of samples, set register 0x81 to 2^n, and set register 0x82 to n. This tells the controller to sum 2^n samples, and then divide by x^n, resulting in the avarage value, which can be read from registers 0x68 .. 0x6f, depending on the channel.<br>
For more then 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy then the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel.
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
898018d084670090dd33c717ae9c6ebba4ba40fc
2270
2268
2012-11-16T12:48:40Z
Tom
4
/* Using the analog inputs */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Setting up the ADC ==
== Taking measurements ==
Will be completed ASAP (nov. 12 2012) <br>
<br>
The built-in ADC has 10 bits of resolution, and can be used in different ways:<br>
* Just read one single sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but very prone to noise. The second option gives you the ability to filter out the noise, and/or avarage a number of samples.<br>
To take the avarage of a number of samples, set register 0x81 to 2^n, and set register 0x82 to n. This tells the controller to sum 2^n samples, and then divide by x^n, resulting in the avarage value, which can be read from registers 0x68 .. 0x6f, depending on the channel.<br>
For more then 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy then the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel.
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
2a716b6549b91bd47a07859a5b87bb969dab096f
2271
2270
2012-11-16T13:12:20Z
Tom
4
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be used in different ways:<br>
* Just read one single sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but very prone to noise. The second option gives you the ability to filter out the noise, and/or avarage a number of samples.<br>
To take the avarage of a number of samples, set register 0x81 to 2^n, and set register 0x82 to n. This tells the controller to sum 2^n samples, and then divide by x^n, resulting in the avarage value, which can be read from registers 0x68 .. 0x6f, depending on the channel.<br>
For more then 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy then the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the ammount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an avarage value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x10 || Add 16 (2^4) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
bfb9540327827a98c3052e3387eabda9b6c9ef7d
MPU-6050 sensor connected to Raspberry Pi
0
1149
1836
2012-10-01T10:18:33Z
Tom
4
Created page with "I was bored on a rainy sunday afternoon, so I connected an MPU-6050 6DOF (3 axis acceleromter, 3 axis gyroscope, thermometer) sensor to the I2C bus of my raspberry Pi. I also ..."
wikitext
text/x-wiki
I was bored on a rainy sunday afternoon, so I connected an MPU-6050 6DOF (3 axis acceleromter, 3 axis gyroscope, thermometer) sensor to the I2C bus of my raspberry Pi. I also wrote some scripts to retrieve parse data. This is still a work in progress, but the basic features work.
= The scripts =
Script to initialize the MPU-6050 (I named it mpu-6050-init):
#! /bin/sh
i2cset -y 0 0x68 0x6b 0
Script to read a byte (I named it mpu-6050-getbyte):
#! /bin/sh
ADDR=$1
i2cget -y 0 0x68 0x$ADDR | sed -e 's/^0x//g' | tr a-z A-Z
Script to read a word (I named it mpu-6050-getword):
#! /bin/sh
ADDR=`echo $1 | tr a-z A-Z`
ADDR2=`echo "ibase=16; obase=10; $ADDR+1" | bc`
VARmsb=`./mpu-6050-getbyte $ADDR;`
VARlsb=`./mpu-6050-getbyte $ADDR2;`
echo $VARmsb$VARlsb
Script to read the temperatue (I named it mpu-6050-gettemp):
#! /bin/sh
TEMP=`./mpu-6050-getword 41`
echo "ibase=16; scale=3; ((-((FFFF-$TEMP)+1))/154)+24.87" | bc
Script to read the accelerometers (I named it mpu-6050-getaccel):
#! /bin/sh
echo X: `./mpu-6050-getword 3B`
echo Y: `./mpu-6050-getword 3D`
echo Z: `./mpu-6050-getword 3F`
Script to read the gyroscopes (I named it mpu-6050-getgyro):
#! /bin/sh
echo X: `./mpu-6050-getword 43`
echo Y: `./mpu-6050-getword 45`
echo Z: `./mpu-6050-getword 47`
Script to read everything (I named it mpu-6050-getall):
#! /bin/sh
echo Accelerometer:
./mpu-6050-getaccel
echo
echo Gyroscope:
./mpu-6050-getgyro
echo
echo Temperature:
./mpu-6050-gettemp
PLEASE NOTE: These scripts are written on a version 1 board. To run them on a version 2, change the I2C bus from "0" to "1".
= Using the scripts =
To use these scripts, you need an I2C enabled Raspberry Pi. [[RPi_SPI_wheezy|This]] manual shosw you how to install the right modules.
You might need to enable the I2C modules, so, as root, do
modprobe i2c-dev
Now the root user can talk to the I2C bus. To enable an other user to talk to the I2C bus, without root privileges, run the following command as root:
sudo usermod -a -G i2c <username>
The scripts also use bc, a calculator program. Install this by running the following command as root:
apt-get install bc
The MPU-6050 boots up in a sleep mode, with all sensors disabled. To wake it up, run the mpu-6050-init script. Now you can start probing the MPU-6050. My first test was measuring the temperature, and see it change:
watch -n 0.5 mpu-6050-gettemp
If you grab hold of the sensor, you should see the reading go up.
e370b121762ae6cd6522befb508db842e08704fd
1837
1836
2012-10-01T10:39:24Z
Tom
4
/* The scripts */
wikitext
text/x-wiki
I was bored on a rainy sunday afternoon, so I connected an MPU-6050 6DOF (3 axis acceleromter, 3 axis gyroscope, thermometer) sensor to the I2C bus of my raspberry Pi. I also wrote some scripts to retrieve parse data. This is still a work in progress, but the basic features work.
= The scripts =
Download link for all the scripts: http://www.bitwizard.nl/software/mpu-6050-tools.tar.gz
Script to initialize the MPU-6050 (I named it mpu-6050-init):
#! /bin/sh
i2cset -y 0 0x68 0x6b 0
Script to read a byte (I named it mpu-6050-getbyte):
#! /bin/sh
ADDR=$1
i2cget -y 0 0x68 0x$ADDR | sed -e 's/^0x//g' | tr a-z A-Z
Script to read a word (I named it mpu-6050-getword):
#! /bin/sh
ADDR=`echo $1 | tr a-z A-Z`
ADDR2=`echo "ibase=16; obase=10; $ADDR+1" | bc`
VARmsb=`./mpu-6050-getbyte $ADDR;`
VARlsb=`./mpu-6050-getbyte $ADDR2;`
echo $VARmsb$VARlsb
Script to read the temperatue (I named it mpu-6050-gettemp):
#! /bin/sh
TEMP=`./mpu-6050-getword 41`
echo "ibase=16; scale=3; ((-((FFFF-$TEMP)+1))/154)+24.87" | bc
Script to read the accelerometers (I named it mpu-6050-getaccel):
#! /bin/sh
echo X: `./mpu-6050-getword 3B`
echo Y: `./mpu-6050-getword 3D`
echo Z: `./mpu-6050-getword 3F`
Script to read the gyroscopes (I named it mpu-6050-getgyro):
#! /bin/sh
echo X: `./mpu-6050-getword 43`
echo Y: `./mpu-6050-getword 45`
echo Z: `./mpu-6050-getword 47`
Script to read everything (I named it mpu-6050-getall):
#! /bin/sh
echo Accelerometer:
./mpu-6050-getaccel
echo
echo Gyroscope:
./mpu-6050-getgyro
echo
echo Temperature:
./mpu-6050-gettemp
PLEASE NOTE: These scripts are written on a version 1 board. To run them on a version 2, change the I2C bus from "0" to "1".
= Using the scripts =
To use these scripts, you need an I2C enabled Raspberry Pi. [[RPi_SPI_wheezy|This]] manual shosw you how to install the right modules.
You might need to enable the I2C modules, so, as root, do
modprobe i2c-dev
Now the root user can talk to the I2C bus. To enable an other user to talk to the I2C bus, without root privileges, run the following command as root:
sudo usermod -a -G i2c <username>
The scripts also use bc, a calculator program. Install this by running the following command as root:
apt-get install bc
The MPU-6050 boots up in a sleep mode, with all sensors disabled. To wake it up, run the mpu-6050-init script. Now you can start probing the MPU-6050. My first test was measuring the temperature, and see it change:
watch -n 0.5 mpu-6050-gettemp
If you grab hold of the sensor, you should see the reading go up.
195c842091a9f761f693a0b6696db48288087804
1838
1837
2012-10-01T10:41:26Z
Tom
4
wikitext
text/x-wiki
I was bored on a rainy sunday afternoon, so I connected an MPU-6050 6DOF (3 axis acceleromter, 3 axis gyroscope, thermometer) sensor to the I2C bus of my raspberry Pi. I also wrote some scripts to retrieve and parse the data. This is still a work in progress, but the basic features work.
= The scripts =
Download link for all the scripts: http://www.bitwizard.nl/software/mpu-6050-tools.tar.gz
Script to initialize the MPU-6050 (I named it mpu-6050-init):
#! /bin/sh
i2cset -y 0 0x68 0x6b 0
Script to read a byte (I named it mpu-6050-getbyte):
#! /bin/sh
ADDR=$1
i2cget -y 0 0x68 0x$ADDR | sed -e 's/^0x//g' | tr a-z A-Z
Script to read a word (I named it mpu-6050-getword):
#! /bin/sh
ADDR=`echo $1 | tr a-z A-Z`
ADDR2=`echo "ibase=16; obase=10; $ADDR+1" | bc`
VARmsb=`./mpu-6050-getbyte $ADDR;`
VARlsb=`./mpu-6050-getbyte $ADDR2;`
echo $VARmsb$VARlsb
Script to read the temperatue (I named it mpu-6050-gettemp):
#! /bin/sh
TEMP=`./mpu-6050-getword 41`
echo "ibase=16; scale=3; ((-((FFFF-$TEMP)+1))/154)+24.87" | bc
Script to read the accelerometers (I named it mpu-6050-getaccel):
#! /bin/sh
echo X: `./mpu-6050-getword 3B`
echo Y: `./mpu-6050-getword 3D`
echo Z: `./mpu-6050-getword 3F`
Script to read the gyroscopes (I named it mpu-6050-getgyro):
#! /bin/sh
echo X: `./mpu-6050-getword 43`
echo Y: `./mpu-6050-getword 45`
echo Z: `./mpu-6050-getword 47`
Script to read everything (I named it mpu-6050-getall):
#! /bin/sh
echo Accelerometer:
./mpu-6050-getaccel
echo
echo Gyroscope:
./mpu-6050-getgyro
echo
echo Temperature:
./mpu-6050-gettemp
PLEASE NOTE: These scripts are written on a version 1 board. To run them on a version 2, change the I2C bus from "0" to "1".
= Using the scripts =
To use these scripts, you need an I2C enabled Raspberry Pi. [[RPi_SPI_wheezy|This]] manual shosw you how to install the right modules.
You might need to enable the I2C modules, so, as root, do
modprobe i2c-dev
Now the root user can talk to the I2C bus. To enable an other user to talk to the I2C bus, without root privileges, run the following command as root:
sudo usermod -a -G i2c <username>
The scripts also use bc, a calculator program. Install this by running the following command as root:
apt-get install bc
The MPU-6050 boots up in a sleep mode, with all sensors disabled. To wake it up, run the mpu-6050-init script. Now you can start probing the MPU-6050. My first test was measuring the temperature, and see it change:
watch -n 0.5 mpu-6050-gettemp
If you grab hold of the sensor, you should see the reading go up.
72914894b8ed79152ddf550e1f3e2bd786e9ffcf
1839
1838
2012-10-01T10:43:57Z
Tom
4
/* Using the scripts */
wikitext
text/x-wiki
I was bored on a rainy sunday afternoon, so I connected an MPU-6050 6DOF (3 axis acceleromter, 3 axis gyroscope, thermometer) sensor to the I2C bus of my raspberry Pi. I also wrote some scripts to retrieve and parse the data. This is still a work in progress, but the basic features work.
= The scripts =
Download link for all the scripts: http://www.bitwizard.nl/software/mpu-6050-tools.tar.gz
Script to initialize the MPU-6050 (I named it mpu-6050-init):
#! /bin/sh
i2cset -y 0 0x68 0x6b 0
Script to read a byte (I named it mpu-6050-getbyte):
#! /bin/sh
ADDR=$1
i2cget -y 0 0x68 0x$ADDR | sed -e 's/^0x//g' | tr a-z A-Z
Script to read a word (I named it mpu-6050-getword):
#! /bin/sh
ADDR=`echo $1 | tr a-z A-Z`
ADDR2=`echo "ibase=16; obase=10; $ADDR+1" | bc`
VARmsb=`./mpu-6050-getbyte $ADDR;`
VARlsb=`./mpu-6050-getbyte $ADDR2;`
echo $VARmsb$VARlsb
Script to read the temperatue (I named it mpu-6050-gettemp):
#! /bin/sh
TEMP=`./mpu-6050-getword 41`
echo "ibase=16; scale=3; ((-((FFFF-$TEMP)+1))/154)+24.87" | bc
Script to read the accelerometers (I named it mpu-6050-getaccel):
#! /bin/sh
echo X: `./mpu-6050-getword 3B`
echo Y: `./mpu-6050-getword 3D`
echo Z: `./mpu-6050-getword 3F`
Script to read the gyroscopes (I named it mpu-6050-getgyro):
#! /bin/sh
echo X: `./mpu-6050-getword 43`
echo Y: `./mpu-6050-getword 45`
echo Z: `./mpu-6050-getword 47`
Script to read everything (I named it mpu-6050-getall):
#! /bin/sh
echo Accelerometer:
./mpu-6050-getaccel
echo
echo Gyroscope:
./mpu-6050-getgyro
echo
echo Temperature:
./mpu-6050-gettemp
PLEASE NOTE: These scripts are written on a version 1 board. To run them on a version 2, change the I2C bus from "0" to "1".
= Using the scripts =
To use these scripts, you need an I2C enabled Raspberry Pi. [[RPi_SPI_wheezy|This]] manual shosw you how to install the right modules.
You might need to enable the I2C modules, so, as root, do
modprobe i2c-dev
Now the root user can talk to the I2C bus. To enable an other user to talk to the I2C bus, without root privileges, run the following command as root:
sudo usermod -a -G i2c <username>
The scripts also use bc, a calculator program. Install this by running the following command as root:
apt-get install bc
The MPU-6050 boots up in a sleep mode, with all sensors disabled. To wake it up, run the mpu-6050-init script. Now you can start probing the MPU-6050. My first test was measuring the temperature, and see it change:
watch -n 0.5 mpu-6050-gettemp
If you grab hold of the sensor, you should see the reading go up.
Sample output for "./mpu-6050-getall":
Accelerometer:
X: F0D4
Y: 3874
Z: E3A4
Gyroscope:
X: FFF1
Y: FF03
Z: FFE2
Temperature:
25.791
779b41fc556e4430e072ee55c3169a4281936b3a
LCD + 3FETs demonstration
0
1221
1914
2012-10-10T13:24:48Z
Tom
4
Created page with "This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=enJEksPqWqo = Things we used = * [http://www.bitwizard.nl/catalo..."
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=enJEksPqWqo
= Things we used =
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=72 SPI 3FETs]
* Common-Anode RGB LED strip
* 12V Power supply
= Steps to take =
Since we want to display different texts on two daisy-chained display's, we needed to change the address of one of the display's:
* Only connect the display who's address you want to chacnge, to the SPI0 port of your RPi
* Execute the following command: "sudo ./bw_lcd -a 82 -r 240 -v 128
Now this display should be listening on port 80.
Now connect al the SPI modules in one chain, hook up the power supply and LED strip to the 3FETs board, and run the following script as root:
#!/bin/sh
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
# Print welcome message to LCDs
./bw_lcd -a 80 -T 0,0 'Raspberry Pi'
./bw_lcd -a 80 -T 0,1 'controlling two'
./bw_lcd -a 82 -T 0,0 'LCD modules and'
./bw_lcd -a 82 -T 0,1 'an RGB LED strip'
#Enable PWM on 3FETs board
./bw_lcd -a 8A -r 95 -v 7
sleep 2
#Play with colors
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 "Let's try some"
./bw_lcd -a 80 -T 0,1 'simple colors'
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Red'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Yellow'
./bw_lcd -a 8A -r 81 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Green'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Cyan'
./bw_lcd -a 8A -r 80 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'White'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Violet'
./bw_lcd -a 8A -r 81 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Blue'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 ''
./bw_lcd -a 8A -r 80 -v 0
sleep 1
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 'Nice, eh?'
27592bcf927995fd2666e98ec0e558af70115ea7
Connecting a motor and 1602 LCD to a Raspberry Pi
0
1223
1917
2012-10-10T13:33:32Z
Tom
4
Created page with "This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=zSQDuy-uu8I = Things we used = * [http://www.bitwizard.nl/catalo..."
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=zSQDuy-uu8I
= Things we used =
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=67 SPI 3FETs]
* Small electric motor
We chose a small DC motor which works on 5VDC, so we could power it directly from the RPi. It is, however, possible to connect an external power supply, to drive motors (or other stuff) which require a different voltage then the 5V provided by the Pi.
= Steps to take =
We split this up in two seperate scripts:
set_pwm
#!/bin/sh
pwmval=$1
bw_tool -C -t "BW spi 7fets PWM"
bw_tool -w 11:20
bw_tool -t "test: $pwmval"
bw_tool -a 88 -w 50:$pwmval
test_pwm
#!/bin/sh
./set_pwm 58
./set_pwm 48
sleep 4
for i in 50 60 70 80 90 a0 b0 c0 d0 e0 f0 ff ; do
./set_pwm $i
sleep 0.5
done
sleep 1
for i in ff f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 0 ; do
./set_pwm $i
sleep 0.5
done
Put both scripts in your homedir, and run the test_pwm script as root, and you're done!
6324c25d919144af22093e32d0df34a4d1797a49
User:Rew
2
1504
2204
2012-10-31T15:04:40Z
Rew
3
Created page with "This is a test."
wikitext
text/x-wiki
This is a test.
afa6c8b3a2fae95785dc7d9685a57835d703ac88
User Interface
0
1505
2205
2012-10-31T15:10:20Z
Tom
4
Created page with "=== Under construction ==="
wikitext
text/x-wiki
=== Under construction ===
83da28d5736eed06c5d3c5e00f140104ead967de
2208
2205
2012-10-31T16:30:16Z
Tom
4
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1
|-
| 0x21 || read button 2
|-
| 0x22 || read button 3
|-
| 0x23 || read button 4
|-
| 0x24 || read button 5
|-
| 0x25 || read button 6
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|}
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
6f2586f2d2db92922cd763ad5e3d2e17f5475aa8
Raspberry Pi Serial
0
59
2207
1702
2012-10-31T15:55:27Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
== Pinout ==
The 26 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools .
git clone https://github.com/rewolff/bw_rpi_tools.git
Now, you can use the tools in either the SPI or I2C subdirectory to communicate with bitwizard SPI or I2C boards that you might have.
== getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== changelog ===
* Initial public release
434cbef9d5ad3516a6bd1c210b128001bf2c62f2
File:RPi-UI.jpg
6
1507
2209
2012-10-31T16:58:46Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
USB-SATA powerswitch
0
7
2244
139
2012-11-06T06:45:45Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo s2 > COM3
sleep -m 200
echo s1 > COM3
sleep -m 200
echo s0 > COM3
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
74561d1bb96cdedfbddd2a79001c0c05f660e587
2269
2244
2012-11-14T07:41:20Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo s2 > COM3
sleep -m 200
echo s1 > COM3
sleep -m 200
echo s0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
a95b6816af40ba6309d0affe72935fb73c65bdf4
SPI SPI
0
1555
2273
2012-11-16T14:03:09Z
Tom
4
Created page with "[[File:spi_spi.jpg|thumb|300px|alt=spi_spi|The spi_spi board]] This is the documentation page for . == Overview == == Assembly instructions == === Possible Configuratio..."
wikitext
text/x-wiki
[[File:spi_spi.jpg|thumb|300px|alt=spi_spi|The spi_spi board]]
This is the documentation page for .
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
37d15f995e39283f2d9d419c971aeeba04c583f3
7 Segment
0
1556
2274
2012-11-16T14:03:10Z
Tom
4
Created page with "[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]] This is the documentation page for the 7_segment boards. == Overview ..."
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
53e5be540a2a140a0931f75ddb5ac6ea13d7fbd9
Pushbutton
0
1557
2275
2012-11-16T14:03:13Z
Tom
4
Created page with "[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]] This is the documentation page for . == Overview == == Assembl..."
wikitext
text/x-wiki
[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]]
This is the documentation page for .
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
b2f59562efcf50ba681c3f8034c8dbb1201cd52a
7 Segment
0
1556
2276
2274
2012-11-16T14:05:23Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
| 0xf0 || change address.
|}
=== read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1
|-
| 0x21 || read button 2
|-
| 0x22 || read button 3
|-
| 0x23 || read button 4
|-
| 0x24 || read button 5
|-
| 0x25 || read button 6
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
214e734ff525e50f20e60d022d6499cf6a0dd044
2277
2276
2012-11-16T14:05:39Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
|-
| 0xf0 || change address.
|}
=== read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1
|-
| 0x21 || read button 2
|-
| 0x22 || read button 3
|-
| 0x23 || read button 4
|-
| 0x24 || read button 5
|-
| 0x25 || read button 6
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
722acc658132d207ea9831689c2e8de4b09bdd76
2278
2277
2012-11-16T14:11:49Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
195e8e322a69276006282691d1776056514e5f7d
2284
2278
2012-11-16T14:53:51Z
Tom
4
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
There are no LEDs, except for the display of course.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny48 on the board.
== Programming ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x10 || Write a bitmap to the display (see [[#bitmap]]) (4 bytes)
|-
| 0x11 || Write a hexadecimal number to the display (4 bytes)
|-
| 0x20 .. 0x23 || Write a bitmap to only 1 character
|-
| 0x30 .. 0x33 || Write a hexadecimal numer to only 1 character
|-
| 0x40 || Write a value other then 0x00 to light the bottom dot, 0x00 turns it off.
|-
| 0x41 || Write a value other then 0x00 to light the upper dot, 0x00 turns it off.
|-
| 0x42 || Write a value other then 0x00 to light both dots, 0x00 turns them off.
|-
| 0xf0 || change address.
|}
=== read ports ===
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || Return the entire bitmap (see [[#bitmap]]) (4 bytes)
|-
| 0x20 .. 0x23 || Return the bitmap of 1 character
|}
=== Bitmap ===
It is possible to tell the module to not show a hexadecimal digit, bit to display a user-defined digit.<br>
The most significant bit in this bitmap controls segment A, and the least significant bit controls one of the dots. The lower dot is controlled by digit 2, and the upper dot by digit 3.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
e4cb52187209da0442284e02f1a63e8f9c0d7a8b
Pushbutton
0
1557
2279
2275
2012-11-16T14:12:01Z
Tom
4
/* The software */
wikitext
text/x-wiki
[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]]
This is the documentation page for .
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Programming ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
|-
| 0xf0 || change address.
|}
=== read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1
|-
| 0x21 || read button 2
|-
| 0x22 || read button 3
|-
| 0x23 || read button 4
|-
| 0x24 || read button 5
|-
| 0x25 || read button 6
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== ===
* Initial public release
9a93622530fd4d34c1ebdd8a51e111ad320c97ea
2280
2279
2012-11-16T14:18:11Z
Tom
4
wikitext
text/x-wiki
[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]]
This is the documentation page for the pushbutton boards.
== Overview ==
This board adds 4 pushbuttons to your I2C or SPI enabled device.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI0 into an ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
|-
| 0xf0 || change address.
|}
=== read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1
|-
| 0x21 || read button 2
|-
| 0x22 || read button 3
|-
| 0x23 || read button 4
|-
| 0x24 || read button 5
|-
| 0x25 || read button 6
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0df6b50df2aa2c8846f96d1ca948d38498908891
2290
2280
2012-11-16T16:41:08Z
Tom
4
/* read ports */
wikitext
text/x-wiki
[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]]
This is the documentation page for the pushbutton boards.
== Overview ==
This board adds 4 pushbuttons to your I2C or SPI enabled device.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI0 into an ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
|-
| 0xf0 || change address.
|}
=== read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all buttons
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ee2bd9b20b07e405db39cfb41784a7994ab2d15c
File:Spi pushbutton.jpg
6
1558
2281
2012-11-16T14:20:53Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Spi 7segment.jpg
6
1559
2282
2012-11-16T14:23:11Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Spi spi.jpg
6
1560
2283
2012-11-16T14:23:42Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
DIO protocol
0
432
2285
2271
2012-11-16T15:10:26Z
Rew
3
/* Taking measurements */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the ammount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an avarage value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x10 || Add 16 (2^4) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
2691822f5600ac6409beebac7aba11e009bcf1a3
2286
2285
2012-11-16T15:11:04Z
Rew
3
/* Setting up the ADC */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x10 || Add 16 (2^4) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
8c0a2b145cc5665e0cc6a08f12d7d542205fc563
2287
2286
2012-11-16T15:13:49Z
Rew
3
/* Example */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
74cbf14764be08914f5ef9eeb824e17e4f1ee97b
2288
2287
2012-11-16T15:17:59Z
Rew
3
/* Setting up the ADC */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x12 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
83e42582161d263983f66bb4269c55b97db40dc9
2291
2288
2012-11-16T16:54:52Z
Tom
4
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
04f51af59ae13dc76580c6c64d064fe9017b6e9f
2304
2291
2012-11-21T16:42:50Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
4284b798123c7a099161b651fe8fcd1e0174ad07
2305
2304
2012-11-21T16:43:18Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
858a9866d9422e4053750a5996bd561b287f8253
2306
2305
2012-11-21T16:52:00Z
Rew
3
/* Using the analog inputs */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return ammounts of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
5bda0cdd31ee81ca1025c4a7330b3884a483cb5d
User Interface
0
1505
2289
2208
2012-11-16T15:32:51Z
Tom
4
/* read ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 1 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|}
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c821bc054f158a49ec510cc0d0608ae3ba5b8cda
2292
2289
2012-11-16T17:10:24Z
Tom
4
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 1 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage is 1V1, so don't try to measure voltages higher then that with the analog input.
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0x07
|-
| ext || 0x06
|}
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
6301cebad0f3552cea044b0373ef1342af9a8186
2309
2292
2012-11-23T16:27:36Z
Tom
4
/* Using the analog inputs */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 1 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
2c7880cd3f0c4e59ee7cfb64bf1c85d5b1f30360
2310
2309
2012-11-23T16:28:29Z
Tom
4
/* Using the analog inputs */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 1 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5a31a5fb5cadafee2348111563350e077e88a0ab
2318
2310
2012-12-03T15:15:14Z
Rew
3
/* Using the temperature sensor */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 1 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]]
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f8b66f38f2b50a05e303f3e36946d3d5a3a3da23
2319
2318
2012-12-03T15:15:23Z
Rew
3
/* Using the temperature sensor */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 1 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
bbfb550cfea5d22be9a3abe91bf4c0f2bdd12eb4
2324
2319
2012-12-03T15:22:10Z
Tom
4
/* read ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 1 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 1 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 1 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 1 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 1 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 1 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 1 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
48e24ef22d916940eaaa265afa4e4fc7a43a7477
DIO
0
52
2296
1207
2012-11-18T09:55:26Z
Rew
3
/* Overview */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to read analog inputs!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
951c454e962b7d7417a574eb3249b718e1c225bb
2297
2296
2012-11-18T09:55:58Z
Rew
3
/* Overview */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as analog inputs!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
1643c81eaf6b7f9e0acf30833e8d630a4d993d68
Motor
0
658
2298
1315
2012-11-20T15:58:34Z
Rew
3
/* Jumper */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 8V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
ca783e6e8089f1d3ab952ebae566fa1ecb60ccd0
2299
2298
2012-11-20T15:58:44Z
Rew
3
/* Jumper */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <8V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
eadbdaf17cbd2da16577eaaad30785bbba080ff2
2300
2299
2012-11-20T15:58:54Z
Rew
3
/* Jumper */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output A1
|-
| 2 || Output A2
|-
| 3 || Output B1
|-
| 4 || Output B2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
73bc8ecda454bd76d7bf7a6bc328cb72a84e8b95
2302
2300
2012-11-21T15:16:43Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 8V to 14V power supply. Plese refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
2c9b5eb91f6a2b2bb17d1668ee2e54f82651884f
Default addresses
0
484
2301
2264
2012-11-21T12:18:36Z
Rew
3
wikitext
text/x-wiki
{| border=1
! Board !! Address
|-
| tw_LCD || 0x82
|-
| tw_DIO || 0x84
|-
| tw_SERVO || 0x86
|-
| tw_7FETs || 0x88
|-
| tw_3FETs || 0x8A
|-
| tw_TEMP (sometimes called SPI_LM35) || 0x8C
|-
| tw_RELAY || 0x8E
|-
| tw_motor || 0x90
|-
| tw_pipower || 0x92
|-
| RPi_UI || 0x94
|-
| tw_7segment || 0x96
|-
| spi_spi || 0x98
|-
| tw_pushbutton || 0x9A
|-
| tw_pushbutton || 0x9C
|}
e6ea0fa3b2f6e8a4b99d01e83909a1c4b7793c52
2303
2301
2012-11-21T16:01:32Z
Tom
4
wikitext
text/x-wiki
{| border=1
! Board !! Address
|-
| tw_LCD || 0x82
|-
| tw_DIO || 0x84
|-
| tw_SERVO || 0x86
|-
| tw_7FETs || 0x88
|-
| tw_3FETs || 0x8A
|-
| tw_TEMP (sometimes called SPI_LM35) || 0x8C
|-
| tw_RELAY || 0x8E
|-
| tw_motor || 0x90
|-
| tw_pipower || 0x92
|-
| RPi_UI || 0x94
|-
| tw_7segment || 0x96
|-
| spi_spi || 0x98
|-
| tw_pushbutton || 0x9A
|-
| || 0x9C
|-
| tw_bigrelay || 0x9E
|}
e61cbff3c185d02f3251b6796d5c18d43060c87c
Relay
0
53
2308
1214
2012-11-23T14:39:51Z
Tom
4
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
bb812bf0be15a9029a1458c8461fcbdda28885fd
Temperature sensor example
0
1571
2320
2012-12-03T15:16:31Z
Rew
3
Created page with " == initialization == #!/bin/sh bw_tool -a 94 -w 70:c7 # internal tempsens with internal 1.1V as reference bw_tool -a 94 -w 71:c6 # external tempsens with internal 1.1V as..."
wikitext
text/x-wiki
== initialization ==
#!/bin/sh
bw_tool -a 94 -w 70:c7 # internal tempsens with internal 1.1V as reference
bw_tool -a 94 -w 71:c6 # external tempsens with internal 1.1V as reference
bw_tool -a 94 -W 81:1000
bw_tool -a 94 -w 82:6
bw_tool -a 94 -w 80:2
== readout ==
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -s 100000 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
680ceaba97d3026dbe4c122666d87210709bb141
2321
2320
2012-12-03T15:17:07Z
Rew
3
/* initialization */
wikitext
text/x-wiki
== initialization ==
The following is a script that I use to initialize the temperature sensors for the rpi_ui board.
#!/bin/sh
bw_tool -a 94 -w 70:c7 # internal tempsens with internal 1.1V as reference
bw_tool -a 94 -w 71:c6 # external tempsens with internal 1.1V as reference
bw_tool -a 94 -W 81:1000
bw_tool -a 94 -w 82:6
bw_tool -a 94 -w 80:2
== readout ==
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -s 100000 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
19886aa34137d32dd63dced052728ccb22a3c89d
2322
2321
2012-12-03T15:17:32Z
Rew
3
/* readout */
wikitext
text/x-wiki
== initialization ==
The following is a script that I use to initialize the temperature sensors for the rpi_ui board.
#!/bin/sh
bw_tool -a 94 -w 70:c7 # internal tempsens with internal 1.1V as reference
bw_tool -a 94 -w 71:c6 # external tempsens with internal 1.1V as reference
bw_tool -a 94 -W 81:1000
bw_tool -a 94 -w 82:6
bw_tool -a 94 -w 80:2
== readout ==
The following is a script that shows the temperature on stdout.
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -s 100000 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
5d8500fde46103a6270340968a22a0c71e66d173
2323
2322
2012-12-03T15:21:16Z
Rew
3
/* readout */
wikitext
text/x-wiki
== initialization ==
The following is a script that I use to initialize the temperature sensors for the rpi_ui board.
#!/bin/sh
bw_tool -a 94 -w 70:c7 # internal tempsens with internal 1.1V as reference
bw_tool -a 94 -w 71:c6 # external tempsens with internal 1.1V as reference
bw_tool -a 94 -W 81:1000
bw_tool -a 94 -w 82:6
bw_tool -a 94 -w 80:2
== readout ==
The following is a script that shows the temperature on stdout. I call this script "showtemp".
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -s 100000 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
== display ==
The following clears the screen and then shows the temperature.
bw_tool -a 94 -w 10:0
bw_tool -a 94 -t "temp: "`./showtemp`
5f9c6037c89cfee3ece54cd953e00fa2866c99e9
Main Page
0
1
2325
2272
2012-12-04T14:38:28Z
Tom
4
/* Developement boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
f38d8bcbc65dd3928fb3c5c3c3ca88387bdb7eb0
Raspduino
0
1572
2326
2012-12-04T15:19:56Z
Tom
4
Created page with "[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]] This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduin..."
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
The Raspduino is equipped with an ATmega328 controller.
== Pinout ==
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector.
=== I2C jumpers ===
It is possible to connect the Raspberry Pis I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Voltage selection jumper ===
It is possible to run the AVR on 3V3 or 5V when the Raspduino is connected to a Raspberry Pi. 5V Is thee default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged in, or if it is used stand-alone, you can connect an external power supply to the "External Power" conncetor. The supply voltage should be between 3V3 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
bae9e79674b32cb5f353da14a68bd6d453729657
2328
2326
2012-12-05T12:55:35Z
Rew
3
/* ICSP/SPI jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
The Raspduino is equipped with an ATmega328 controller.
== Pinout ==
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect to one of the the BitWizard SPI expansion boards from the arduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pis I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Voltage selection jumper ===
It is possible to run the AVR on 3V3 or 5V when the Raspduino is connected to a Raspberry Pi. 5V Is thee default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged in, or if it is used stand-alone, you can connect an external power supply to the "External Power" conncetor. The supply voltage should be between 3V3 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
f912830b49f30aa283bcd5dc0260b55db116ec81
2329
2328
2012-12-05T12:55:55Z
Rew
3
/* I2C jumpers */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
The Raspduino is equipped with an ATmega328 controller.
== Pinout ==
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect to one of the the BitWizard SPI expansion boards from the arduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Voltage selection jumper ===
It is possible to run the AVR on 3V3 or 5V when the Raspduino is connected to a Raspberry Pi. 5V Is thee default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged in, or if it is used stand-alone, you can connect an external power supply to the "External Power" conncetor. The supply voltage should be between 3V3 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
3a738dba5c431feebcf4d15f8d782c232a8159fd
2330
2329
2012-12-05T12:56:27Z
Rew
3
/* Voltage selection jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
The Raspduino is equipped with an ATmega328 controller.
== Pinout ==
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect to one of the the BitWizard SPI expansion boards from the arduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Voltage selection jumper ===
It is possible to run the AVR on 3V3 or 5V when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is thee default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged in, or if it is used stand-alone, you can connect an external power supply to the "External Power" conncetor. The supply voltage should be between 3V3 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
6671c48f20aff810b526ab688b08fa8ce6c25cb1
2331
2330
2012-12-05T12:56:47Z
Rew
3
/* Voltage selection jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
The Raspduino is equipped with an ATmega328 controller.
== Pinout ==
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect to one of the the BitWizard SPI expansion boards from the arduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Voltage selection jumper ===
It is possible to run the AVR on 3V3 or 5V when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged in, or if it is used stand-alone, you can connect an external power supply to the "External Power" conncetor. The supply voltage should be between 3V3 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
0219f1f0fb42563028b8249b08095459856996b3
2332
2331
2012-12-05T12:58:03Z
Rew
3
/* Powering the Raspduino */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
The Raspduino is equipped with an ATmega328 controller.
== Pinout ==
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect to one of the the BitWizard SPI expansion boards from the arduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Voltage selection jumper ===
It is possible to run the AVR on 3V3 or 5V when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
e4452afce89d365d8bb6de1afeddabf7b77c8746
2333
2332
2012-12-05T13:56:44Z
Tom
4
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
The Raspduino is equipped with an ATmega328 controller.
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
There are two extra analog pins provided on an extra connector, together with a power pin and a GND pin. The power pin supplies the same voltage the Raspduino is running on (default 5V).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
ff3941049c74d8e796c14f3e13b2d4f7d2fb4cbd
2334
2333
2012-12-05T14:00:37Z
Tom
4
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
There are two extra analog pins provided on an extra connector, together with a power pin and a GND pin. The power pin supplies the same voltage the Raspduino is running on (default 5V).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
5050857f760dda95f75474c8367d64a0d6a1b1f0
2335
2334
2012-12-05T15:36:08Z
Tom
4
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
There are two extra analog pins provided on an extra connector, together with a power pin and a GND pin. The power pin supplies the same voltage the Raspduino is running on (default 5V).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
6409d36fe889d89f900f4c7190af0228cc185fc5
2336
2335
2012-12-05T17:33:11Z
Tom
4
/* Features */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi. It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
There are two extra analog pins provided on an extra connector, together with a power pin and a GND pin. The power pin supplies the same voltage the Raspduino is running on (default 5V).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
d7551d75b4fce2b4d8dd46562a369192511ead63
2341
2336
2012-12-07T16:41:12Z
Tom
4
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this Pi Plates). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
There are two extra analog pins provided on an extra connector, together with a power pin and a GND pin. The power pin supplies the same voltage the Raspduino is running on (default 5V).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi (in theory you'd have to reduce the clock speed to 8MHz if you do this). 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set it to work on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
5221a6a676f5434fe01b79c5d4937a394fc69252
Main Page
0
1
2342
2325
2012-12-07T17:28:17Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
8b52051eeb0150087b1b297c4acf877cfdeb08d6
2343
2342
2012-12-07T17:29:41Z
Tom
4
/* General pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
b5342de8be2277fea3cb04740a6cc0e8f92b83da
Relay
0
53
2344
2308
2012-12-10T12:46:29Z
Rew
3
/* The software */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
7471e3b74f940f657ff58b49830c675551355893
2345
2344
2012-12-10T12:47:43Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
9ba0690e5bb40e6998097ee498b2d418284023fe
Raspduino
0
1572
2347
2341
2012-12-13T23:36:30Z
David
17
/* AVR voltage selection jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this Pi Plates). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
There are two extra analog pins provided on an extra connector, together with a power pin and a GND pin. The power pin supplies the same voltage the Raspduino is running on (default 5V).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
0c46607e5ec94aecce815cf1c118575307b188ec
2348
2347
2012-12-13T23:46:07Z
David
17
/* Extra analog connector */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this Pi Plates). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
4fd2953dab7757cf935dfc291c638290aeedf5e5
2349
2348
2012-12-13T23:48:13Z
David
17
/* AVR voltage selection jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this Pi Plates). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the BitWizard SPI expansion boards from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
8dcfa9b7098b8615bb295beb4715b219874c9a4b
2350
2349
2012-12-13T23:50:43Z
David
17
/* ICSP/SPI jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this Pi Plates). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on out [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
3ac9983f030ceb576ad15ed60ebbbea9a47ac471
2351
2350
2012-12-13T23:53:02Z
David
17
/* Raspberry Pi connectors */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this Pi Plates). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Uploading a sketch ==
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
2cecca1d9c9a3f0d1908ae2c191d634927abed08
2361
2351
2012-12-17T16:21:36Z
Tom
4
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
By default, the Arduino software can't communicate over the /dev/ttyAMA0 serial port, and also doesn't know ow board. We wrote a setup script to patch this.<br>
You can het the script [URL here].<br>
Run this script as root (hint: use sudo), and you should be ready.
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
632e5299ed98e13c3b7890d61ed224847781035f
2362
2361
2012-12-17T16:21:56Z
Tom
4
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
By default, the Arduino software can't communicate over the /dev/ttyAMA0 serial port, and also doesn't know ow board. We wrote a setup script to patch this.<br>
You can het the script [URL here].<br>
Run this script as root (hint: use sudo), and you should be ready to go.
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
587745a7f0828e3de68d4937d43e78affbdf56df
2363
2362
2012-12-17T16:31:34Z
Tom
4
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
By default, the Arduino software can't communicate over the /dev/ttyAMA0 serial port, and also doesn't know ow board. We wrote a setup script to patch this.<br>
You can het the script [https://raw.github.com/rewolff/raspduino_tools/master/setup-raspduino here].<br>
Run this script as root (hint: use sudo), and you should be ready to go.
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
2971b4a87e04957c981f6a4c0eb7e6aa9fa29176
2364
2363
2012-12-17T16:32:38Z
Tom
4
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
By default, the Arduino software can't communicate over the /dev/ttyAMA0 serial port, and also doesn't know ow board. We wrote a setup script to patch this.<br>
You can het the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Run this script as root (hint: use sudo), and you should be ready to go.
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
049782d41bba13ab0a923307623c30da465a8150
2365
2364
2012-12-17T16:52:51Z
Tom
4
/* Connectors and pinout */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
By default, the Arduino software can't communicate over the /dev/ttyAMA0 serial port, and also doesn't know ow board. We wrote a setup script to patch this.<br>
You can het the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Run this script as root (hint: use sudo), and you should be ready to go.
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
acd5aa2284ddbb2c3a7cc86df521cab8102b6931
2366
2365
2012-12-17T16:53:02Z
Tom
4
/* Extra analog connector */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
By default, the Arduino software can't communicate over the /dev/ttyAMA0 serial port, and also doesn't know ow board. We wrote a setup script to patch this.<br>
You can het the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Run this script as root (hint: use sudo), and you should be ready to go.
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
ffbf871be49faef1fc84de148ac77a0c63ef7e9c
2367
2366
2012-12-17T23:34:28Z
David
17
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
245c1571e6f99571a6d60d95beaaa8ba01058897
2368
2367
2012-12-17T23:35:24Z
David
17
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
<pre>wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot</pre>
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
7d35e9e14062eebc26bae70663caea10f6dce2b2
2369
2368
2012-12-17T23:39:20Z
David
17
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, this are the commands you can use:
<pre>sudo apt-get install arduino
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot</pre>
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
71e7f6a3f4bd0469c8c6609156d491e556464ffc
2370
2369
2012-12-17T23:40:20Z
David
17
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
<pre>sudo apt-get install arduino
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot</pre>
== Uploading a sketch ==
If you have run out setup script, this should be pretty easy. Select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
8fd3704fb7db18acc445aec5dfd30cfdd7520e8d
2371
2370
2012-12-17T23:41:43Z
David
17
/* Uploading a sketch */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to connect one of the the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
<pre>sudo apt-get install arduino
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot</pre>
== Uploading a sketch ==
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
de97cab117029512a8f592149c1b0352082d63be
2373
2371
2012-12-19T15:17:12Z
Rew
3
/* ICSP/SPI jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. It might be necessary to run the ATMega at 8MHz when it's running on 3V3.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
<pre>sudo apt-get install arduino
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot</pre>
== Uploading a sketch ==
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
5123c7c2db15aba7eea0a3190dd23bc01a226483
2374
2373
2012-12-19T15:19:13Z
Rew
3
/* AVR voltage selection jumper */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
<pre>sudo apt-get install arduino
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot</pre>
== Uploading a sketch ==
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
0df2a061f030117f3493a03aaaae0cbf4922e6b8
2375
2374
2012-12-19T15:20:35Z
Rew
3
/* Running the setup script */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
== Uploading a sketch ==
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyAMA0 serial port, and the Raspduino board, and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
73b894ee9f9f03a441191e74213b8a50544410ea
2376
2375
2012-12-19T15:21:13Z
Rew
3
/* Uploading a sketch */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
== Features ==
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
== Connectors and pinout ==
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
=== Arduino headers ===
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
=== Raspberry Pi connectors ===
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
=== Power input ===
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
=== Extra analog connector ===
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
== LEDs ==
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
== Jumpers ==
The raspduino has a number of jumpers, to configure it for multiple different scenarios.
=== ICSP/SPI jumper ===
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
=== I2C jumpers ===
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
=== Serial busses voltage selection jumper ===
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
=== AVR voltage selection jumper ===
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
== Powering the Raspduino ==
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
== Running the setup script ==
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
== Uploading a sketch ==
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Future hardware enhancements ==
Suggestions are welcome.
== Changelog ==
=== 1.1 ===
* Initial public release
84c6f4f8155fc2c755f653a08cd3541cf8374311
3FETs
0
483
2358
1508
2012-12-17T10:52:41Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
d971d1affb7ebd7143886a27558a7c87392f42d5
2359
2358
2012-12-17T10:53:06Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
95155ebb85485ce50c519f1da894d2ae8acd1879
File:Raspduino v1.1.jpg
6
1585
2360
2012-12-17T16:00:55Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
User Interface
0
1505
2379
2324
2012-12-21T00:38:22Z
Rew
3
/* read ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f3c53fb7ac688d0e80c0a74128cae4a430cbb623
LCD
0
716
2381
1757
2012-12-23T11:15:36Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
The contrast setting depends strongly on the voltage of the power line. We test the boards with our powersupply and deliver them with a contrast setting that works for us. However if your powersupply has a higher or lower voltage, the proper contrast setting might be different.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
3d280d6363ec4dc8ac80d2281cd225a0a0b441ba
Spi lcd 1.3 protocol
0
112
2383
1746
2012-12-24T10:15:21Z
Rew
3
/* examples */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
9d6e99ae8e1d10c572b02657e364342cb88b6d26
2384
2383
2012-12-24T10:20:36Z
Rew
3
/* examples */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
51fe78a8d8376b885f1591f96a6d47d0e6e80906
2385
2384
2012-12-24T10:20:54Z
Rew
3
/* examples */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
d3035bfd330b4ec4df2dce5c64ef6ae5c816ee02
2386
2385
2012-12-24T10:22:25Z
Rew
3
/* examples */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
c2bdcf932941f7c076b2b6d3de3fbeac6a5883e2
2387
2386
2012-12-24T10:22:43Z
Rew
3
/* set cursor position */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
e7c27d8c39ff65ff4b2a07d064183ddffb968a10
DIO protocol
0
432
2388
2306
2012-12-24T16:02:36Z
Rew
3
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
8e54518df5db9c0b599c946afe8f458b4371f56e
2391
2388
2012-12-25T08:06:54Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
7db6778231c65a4fd0512271749ee321c32f2d22
Analog inputs
0
1593
2392
2012-12-25T08:41:46Z
Rew
3
Created page with "= analog inputs = Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used ..."
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || - || -
|-
| 0x01 || 4 || - || -
|-
| 0x02 || 3 || - || -
|-
| 0x03 || 1 || - || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
== Differential measurements ==
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || - || -
|-
| 0x0a || 6 - 1 || - || -
|-
| 0x28 || 4 - 6 || - || -
|-
| 0x0c || 4 - 3 || - || -
|-
| 0x0e || 4 - 1 || - || -
bbcc0f088cb3e74b229d799a41dc56a134d5926e
2393
2392
2012-12-25T09:04:18Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || - || -
|-
| 0x01 || 4 || - || -
|-
| 0x02 || 3 || - || -
|-
| 0x03 || 1 || - || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || - || -
|-
| 0x0a || 6 - 1 || - || -
|-
| 0x28 || 4 - 6 || - || -
|-
| 0x0c || 4 - 3 || - || -
|-
| 0x0e || 4 - 1 || - || -
|-
| 0x2c || 3 - 4 || - || -
|-
| 0x10 || 3 - 1 || - || -
|-
| 0x2a || 1 - 6 || - || -
|-
| 0x2e || 1 - 4 || - || -
|-
| 0x30 || 1 - 3 || - || -
|-
| 0x24 || 1 - 1 || - || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
5c072f19d65bcc5c6df71368a00026449b814299
2394
2393
2012-12-25T09:18:48Z
Rew
3
/* normal measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || - || -
|-
| 0x01 || 4 || - || -
|-
| 0x02 || 3 || - || -
|-
| 0x03 || 1 || - || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || - || -
|-
| 0x0a || 6 - 1 || - || -
|-
| 0x28 || 4 - 6 || - || -
|-
| 0x0c || 4 - 3 || - || -
|-
| 0x0e || 4 - 1 || - || -
|-
| 0x2c || 3 - 4 || - || -
|-
| 0x10 || 3 - 1 || - || -
|-
| 0x2a || 1 - 6 || - || -
|-
| 0x2e || 1 - 4 || - || -
|-
| 0x30 || 1 - 3 || - || -
|-
| 0x24 || 1 - 1 || - || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
6e4c7aa2ac19c592c386504749cbb1867cd14a6a
2395
2394
2012-12-25T09:26:56Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || - || -
|-
| 0x01 || 4 || - || -
|-
| 0x02 || 3 || - || -
|-
| 0x03 || 1 || - || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || - || -
|-
| 0x0a || 6 - 1 || - || -
|-
| 0x28 || 4 - 6 || - || -
|-
| 0x0c || 4 - 3 || - || -
|-
| 0x0e || 4 - 1 || - || -
|-
| 0x2c || 3 - 4 || - || -
|-
| 0x10 || 3 - 1 || - || -
|-
| 0x2a || 1 - 6 || - || -
|-
| 0x2e || 1 - 4 || - || -
|-
| 0x30 || 1 - 3 || - || -
|-
| 0x24 || 1 - 1 || - || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
3d1aaae0d11b54e8b744015f3f473564752dd8e1
2396
2395
2012-12-25T09:46:31Z
Rew
3
/* normal measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || - || -
|-
| 0x0a || 6 - 1 || - || -
|-
| 0x28 || 4 - 6 || - || -
|-
| 0x0c || 4 - 3 || - || -
|-
| 0x0e || 4 - 1 || - || -
|-
| 0x2c || 3 - 4 || - || -
|-
| 0x10 || 3 - 1 || - || -
|-
| 0x2a || 1 - 6 || - || -
|-
| 0x2e || 1 - 4 || - || -
|-
| 0x30 || 1 - 3 || - || -
|-
| 0x24 || 1 - 1 || - || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
634f256a40a57c02e0577687c90d2edafd5d145b
2397
2396
2012-12-25T09:49:43Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
85a7504df6f75064c755d0176289616472d34fcc
2398
2397
2012-12-25T10:16:06Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 || DIO 3 || DIO 1 || DIO 0
|-
| DIO6 || 0x22* || 0x80 || - || - || -
|-
| DIO4 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3 || - || 0x2c || 0x10 || - || -
|-
| DIO1 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
3ce97c8a723903de6bb4ab3436ec3602af69cc2e
2399
2398
2012-12-25T10:17:04Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x80 || - || - || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || 0x10 || - || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
f8eee39573aac3b43be7f0143f1b3977c6bd618b
2400
2399
2012-12-25T10:18:53Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x80 || - || - || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
43f373d317aca2b07c5474fe17e0b484bd81af32
2401
2400
2012-12-25T10:19:57Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x80 || - || 0x0a || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
7a82857a11e35ece56df01f63e244aee37971a3a
2402
2401
2012-12-25T10:20:39Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
2d9eee4e7f5f32c80d7c75d3a9b88b86f2f0aeb5
2403
2402
2012-12-25T10:21:58Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
5070b2435c2c577aed84747e73d444a966612add
2404
2403
2012-12-25T10:26:09Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
d5f27fa849089541815a73a3f840bfc520e48562
2405
2404
2012-12-25T10:26:46Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small diffences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
af630e24587f877ae47728a0bfd830e66546b8c6
Analog inputs
0
1593
2406
2405
2012-12-25T10:32:39Z
Rew
3
/* Differential x20 measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || -
|-
| 0x01 || 4 || S1 || -
|-
| 0x02 || 3 || S3 || -
|-
| 0x03 || 1 || S4 || -
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
6688b00c598fc3658436f21d4e0cc2ef83dbf7d1
2407
2406
2012-12-25T12:59:46Z
Rew
3
/* normal measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || -
|-
| 0x0a || 6 - 1 || S2 - S4 || -
|-
| 0x28 || 4 - 6 || S1 - S2 || -
|-
| 0x0c || 4 - 3 || S1 - S3 || -
|-
| 0x0e || 4 - 1 || S1 - S4 || -
|-
| 0x2c || 3 - 4 || S3 - S1 || -
|-
| 0x10 || 3 - 1 || S3 - S4 || -
|-
| 0x2a || 1 - 6 || S4 - S2 || -
|-
| 0x2e || 1 - 4 || S4 - S1 || -
|-
| 0x30 || 1 - 3 || S4 - S3 || -
|-
| 0x24 || 1 - 1 || S4 - S4 || -
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 !! DIO4 <br> S1 || DIO 3 <br> S3 || DIO 1 <br>S4 || DIO 0
|-
| DIO6<br> S2 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
46c215891e608760c8e62426116962c4835dcf02
2408
2407
2012-12-25T13:05:56Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! dio6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
ec03392a557b9242dd94d540466f2f78e9a756ef
2409
2408
2012-12-25T13:07:04Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
7d1f3693f29e9dad72b8e1729735521301bf1054
2435
2409
2013-01-07T10:58:05Z
Rew
3
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x18 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
249f8a6c90e38c757c1d638366c6eb7c73a2ccdb
2436
2435
2013-01-07T11:01:42Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x28 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x1a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
2c06bb326f30479c80f7cab38eaa752f0e0edb50
2437
2436
2013-01-07T11:05:57Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x28 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x2a || 0x1e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
400b5fb0a75a3fadc343bd0645b0280805d8797f
2438
2437
2013-01-07T11:08:42Z
Rew
3
/* Differential measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x28 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x2a || 0x2e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
a5722de1aa8892c17c3f39c720543b927c9961a3
Default addresses
0
484
2414
2303
2012-12-28T14:26:01Z
Rew
3
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| LCD || 0x82
|-
| DIO || 0x84
|-
| SERVO || 0x86
|-
| 7FETs || 0x88
|-
| 3FETs || 0x8A
|-
| TEMP (sometimes called SPI_LM35) || 0x8C
|-
| RELAY || 0x8E
|-
| motor || 0x90
|-
| pipower || 0x92
|-
| RPi_UI || 0x94
|-
| 7segment || 0x96
|-
| spi_spi || 0x98
|-
| pushbutton || 0x9A
|-
| || 0x9C
|-
| bigrelay || 0x9E
|-
| thermo || 0x9E
|-
| tw_bigrelay || 0x9E
|}
49a1366a3b29e488b87739df43a049e0fa0e1eba
2415
2414
2012-12-28T14:26:31Z
Rew
3
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| LCD || 0x82
|-
| DIO || 0x84
|-
| SERVO || 0x86
|-
| 7FETs || 0x88
|-
| 3FETs || 0x8A
|-
| TEMP (sometimes called SPI_LM35) || 0x8C
|-
| RELAY || 0x8E
|-
| motor || 0x90
|-
| pipower || 0x92
|-
| RPi_UI || 0x94
|-
| 7segment || 0x96
|-
| spi_spi || 0x98
|-
| pushbutton || 0x9A
|-
| || 0x9C
|-
| bigrelay || 0x9E
|-
| thermo || 0xa0
|-
| ... || 0xA2
|}
a9eb55408d293771c5b6dade62d83fe127513c68
User Interface
0
1505
2417
2379
2012-12-28T15:54:01Z
Rew
3
/* Using the temperature sensor */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f4830eb8de2b6fea25cacb8d8524954573ac2b42
2418
2417
2012-12-28T16:05:53Z
Rew
3
/* I2C */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0cbc2d29a107fc163299096af4aef4700953e85b
2420
2418
2012-12-29T22:16:36Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|thumb|400px|alt=The RPi_UI PCB|The RPi_UI PCB]]
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0c3c689b8a5774af688512f6b7660831cc47a33f
2421
2420
2012-12-29T22:18:32Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
6079b8bc9b395334377a5f00c42f55f73dc6d10b
2422
2421
2012-12-29T22:19:16Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
38d9cec4eed76df9e4b4c1d10d952a79cec1b405
2445
2422
2013-01-09T15:18:29Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
4889a060b24ca1fdd62ac8af3740965603064d25
2490
2445
2013-02-03T19:10:16Z
Bronte
2451
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
6e553421c80e7c496e7a1ecf58c84f36f43ca4b6
2492
2490
2013-02-03T19:20:56Z
Bronte
2451
/* Additional software */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ca76b758d01ca870b5403184ae54144585deb975
File:Rpi ui docu.png
6
1599
2419
2012-12-29T22:13:10Z
Rew
3
image of rpi_ui showing pinout of connectors on the right side.
wikitext
text/x-wiki
image of rpi_ui showing pinout of connectors on the right side.
0ee3691a1e6f8050034b62e521e2d38a1d1b21f3
Getting started with rpi serial and BitWizard expansion boards
0
1039
2427
1706
2013-01-03T10:35:05Z
Rew
3
wikitext
text/x-wiki
Each of the following needs to be expanded. Please add a line or two if you can.
* get raspian
* comment out the two lines in /etc/modprobe.d/raspi-blacklist.conf
* get bw_rpi_tools
git clone https://github.com/rewolff/bw_rpi_tools.git
* compile bw_tool
cd bw_rpi_tools/bw_tool/
make
* install bw_tool
sudo make install
* get rpi-update (no longer necessary?)
* run rpi-update (no longer necessary?)
* reboot (no longer necessary?)
* for the spi version, run
sudo bw_tool -t "hello world"
* for the i2c version on a rev 1 rasbperry pi, run
sudo modprobe i2c-dev
sudo bw_tool -I -t "hello world"
* for the i2c version on a rev 2 raspberry pi, you need to specify the other I2C bus:
sudo bw_tool -I -D /dev/i2c-1 -t "hello world"
(the sample assumes the LCD and displays a text on it.)
Try "-a <youraddress> -i" instead of the '-t "hello world" ' to identify your expansion board.
Fill in the address from [[default addresses]].
a0a32a4819303627de1c24eceb3b018258878e11
2428
2427
2013-01-03T10:35:29Z
Rew
3
wikitext
text/x-wiki
Each of the following needs to be expanded. Please add a line or two if you can.
* get raspian
* comment out the two lines in /etc/modprobe.d/raspi-blacklist.conf (no longer necessary?)
* get bw_rpi_tools
git clone https://github.com/rewolff/bw_rpi_tools.git
* compile bw_tool
cd bw_rpi_tools/bw_tool/
make
* install bw_tool
sudo make install
* get rpi-update (no longer necessary?)
* run rpi-update (no longer necessary?)
* reboot (no longer necessary?)
* for the spi version, run
sudo bw_tool -t "hello world"
* for the i2c version on a rev 1 rasbperry pi, run
sudo modprobe i2c-dev
sudo bw_tool -I -t "hello world"
* for the i2c version on a rev 2 raspberry pi, you need to specify the other I2C bus:
sudo bw_tool -I -D /dev/i2c-1 -t "hello world"
(the sample assumes the LCD and displays a text on it.)
Try "-a <youraddress> -i" instead of the '-t "hello world" ' to identify your expansion board.
Fill in the address from [[default addresses]].
701701c46c6965d845fb5808c9079ad0ef4a6d08
2429
2428
2013-01-04T10:30:10Z
Rew
3
wikitext
text/x-wiki
Each of the following needs to be expanded. Please add a line or two if you can.
* get raspian
* comment out the two lines in /etc/modprobe.d/raspi-blacklist.conf (no longer necessary?)
* get bw_rpi_tools
git clone https://github.com/rewolff/bw_rpi_tools.git
* compile bw_tool
cd bw_rpi_tools/bw_tool/
make
* install bw_tool
sudo make install
* get rpi-update (no longer necessary?)
* run rpi-update (no longer necessary?)
* reboot (no longer necessary?)
* for the spi version, run
sudo bw_tool -t "hello world"
* for the i2c version on a rev 1 rasbperry pi, run
sudo modprobe i2c-dev
sudo bw_tool -I -t "hello world"
* for the i2c version on a rev 2 raspberry pi, you need to specify the other I2C bus:
sudo bw_tool -I -D /dev/i2c-1 -t "hello world"
(the sample assumes the LCD and displays a text on it.)
Try "-a <youraddress> -i" instead of the '-t "hello world" ' to identify your expansion board.
Fill in the address from [[default addresses]].
For example " -a 94 -R 30:b" will read the status of the pushbuttons on the rpi_ui. "-a 94 -t hello" will print a text on the rpi_ui.
2c4194ab5a597587adb084d8e9d0680e81242773
Temperature Interface
0
51
2430
1510
2013-01-04T16:00:46Z
Rew
3
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This page is about temp 1.0. This has never been sold, will never be. Has to be updated for temp 1.1.
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
Option 1: cheap, simple, positive only LM35.
* Install solder jumper
* don't install diode, capacitor, resistors.
Option 2: LM35 with negative temperatures.
* install diode,
* install pullup resistor? 50k
* install pulldown resistor 15k.
* Optional capacitor 100n.
* do not install solder jumper.
Option 3: thermocouple.
* install diode,
* install pullup.
* do not install pulldown.
* do not install solder jumper.
Diodes: PNB7000 or BAS31S or BAV99. should all work. Others should work too. The idea is that at 0.1mA forward current the voltage drop is about 1V.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
9e289ca98cd71484da4bef5cd2233fabd52874fc
2460
2430
2013-01-11T16:41:17Z
Tom
4
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
=== LEDs ===
== Jumper settings ==
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
48870b7c137f0655772298f24e502d8b7735f09e
DIO protocol
0
432
2434
2391
2013-01-07T10:49:28Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position.
|-
| 0x41 || X || X || || || set target position.
|-
| 0x42 || X || X || || || set relative position.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
c55d8e203e2eed56dbdbfc17ce483ed8e6a80f2b
Spi lcd 1.3 protocol
0
112
2440
2387
2013-01-08T08:08:27Z
Rew
3
/* examples */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
0dcf7711ff1ab040f4bb1b2291ba40efaf54d360
Annoying bug
0
1612
2446
2013-01-09T16:05:09Z
Rew
3
Created page with "Earlier versions of RPI_UI and DIO had an annoying bug in the firmware. * Dio 1.3 has fixed firmware. * RPI_UI 1.3 has fixed firmware. The bug in dio manifests it self as..."
wikitext
text/x-wiki
Earlier versions of RPI_UI and DIO had an annoying bug in the firmware.
* Dio 1.3 has fixed firmware.
* RPI_UI 1.3 has fixed firmware.
The bug in dio manifests it self as follows: When you write the value 0x1234 to the nsamp register (0x81) with the value 0x1234 TWICE, the value 0x3412 is read back.
his means that as a workaround for this board, you should byteswap the value you want and then write it twice. This can be done in one SPI transaction of only one byte extra.
In rpi_ui the lower 8 bits will always remain 0x00. So after writing 0x1234 twice, you'll see 0x3400 in the register. This means that you have the choice of using 0x40, the default (i.e. do not touch the register at all) or use a multiple of 0x100.
Luckily this is only an issue for the nsamp register.
277b5be4a27f46b2ed8a1dc8dbb1edbabc524ad5
2447
2446
2013-01-09T16:08:05Z
Rew
3
wikitext
text/x-wiki
Earlier versions of RPI_UI and DIO had an annoying bug in the firmware.
* Dio 1.3 has fixed firmware.
* RPI_UI 1.3 has fixed firmware.
The bug in dio manifests it self as follows: When you write the value 0x1234 to the nsamp register (0x81) with the value 0x1234 TWICE, the value 0x3412 is read back.
his means that as a workaround for this board, you should byteswap the value you want and then write it twice. This can be done in one SPI transaction of only one byte extra.
In rpi_ui the lower 8 bits will always remain 0x00. So after writing 0x1234 twice, you'll see 0x3400 in the register. This means that you have the choice of using 0x40, the default (i.e. do not touch the register at all) or use a multiple of 0x100.
Luckily this is only an issue for the nsamp register. Version 1.3 and further have this problem fixed.
43d777b64577bfbf95c01397573841844e5c1d7e
2448
2447
2013-01-09T16:24:31Z
Rew
3
wikitext
text/x-wiki
Earlier versions of the I2C versions of RPI_UI and DIO had an annoying bug in the firmware.
* Dio 1.3 has fixed firmware.
* RPI_UI 1.3 has fixed firmware.
The bug in dio manifests it self as follows: When you write the value 0x1234 to the nsamp register (0x81) with the value 0x1234 TWICE, the value 0x3412 is read back.
his means that as a workaround for this board, you should byteswap the value you want and then write it twice. This can be done in one SPI transaction of only one byte extra.
In rpi_ui the lower 8 bits will always remain 0x00. So after writing 0x1234 twice, you'll see 0x3400 in the register. This means that you have the choice of using 0x40, the default (i.e. do not touch the register at all) or use a multiple of 0x100.
Luckily this is only an issue for the nsamp register. Version 1.3 and further have this problem fixed.
Example with an I2C rpi_ui with the bug:
raspberrypi:/home/pi# bw_tool -I -a 94 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 94 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 94 -R 81:s
3400
Example with an I2C dio with the bug:
raspberrypi:/home/pi# bw_tool -I -a 84 -R 81:s
0040
raspberrypi:/home/pi# bw_tool -I -a 84 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 84 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 84 -R 81:s
3412
raspberrypi:/home/pi#
b9f4e9170ff4cee0807a29269b4664d298a6ac96
2457
2448
2013-01-10T14:30:16Z
Rew
3
wikitext
text/x-wiki
Earlier versions of the I2C versions of RPI_UI and DIO had an annoying bug in the firmware.
* Dio 1.3 has fixed firmware.
* RPI_UI 1.3 has fixed firmware.
The bug in dio manifests it self as follows: When you write the value 0x1234 to the nsamp register (0x81) with the value 0x1234 TWICE, the value 0x3412 is read back.
his means that as a workaround for this board, you should byteswap the value you want and then write it twice. This could be done in one I2C transaction of only one byte extra (send address, register address, highbyte, lowbyte, highbyte). Or: Send a dummy byte between the register address and the lowbyte.
In rpi_ui the lower 8 bits will always remain 0x00. So after writing 0x1234 twice, you'll see 0x3400 in the register. This means that you have the choice of using 0x40, the default (i.e. do not touch the register at all) or use a multiple of 0x100. (the lowbyte will always be ignored anyway, so the shortest way is to just send the highbyte. Or you can treat it the same as i2c_dio above: send three bytes).
Luckily this is only an issue for the nsamp register. Version 1.3 and further have this problem fixed.
Example with an I2C rpi_ui with the bug:
raspberrypi:/home/pi# bw_tool -I -a 94 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 94 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 94 -R 81:s
3400
Example with an I2C dio with the bug:
raspberrypi:/home/pi# bw_tool -I -a 84 -R 81:s
0040
raspberrypi:/home/pi# bw_tool -I -a 84 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 84 -W 81:1234
raspberrypi:/home/pi# bw_tool -I -a 84 -R 81:s
3412
raspberrypi:/home/pi#
f72d9145800cad8037abca3bedeada1fbcee4b0a
LCD
0
716
2449
2381
2013-01-10T08:19:00Z
Rew
3
/* Programming */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
The contrast setting depends strongly on the voltage of the power line. We test the boards with our powersupply and deliver them with a contrast setting that works for us. However if your powersupply has a higher or lower voltage, the proper contrast setting might be different.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with a raspberry pi there are a few options. For the I2C version, you can get http://www.bitwizard.nl/software/bw_rpi_tools-20120616.tgz . The GPIO directory in that archive contains some programs to communicate with the LCD with a userspace driver. There is also a kernel-space driver for the I2C module, but I haven't looked at accessing that from userspace yet. (the kernel-space driver will allow other kernel drivers, for example for a temperature sensor, to access the I2C bus).
For SPI on the raspberry pi, the same gpio directory contains "send_spi". It will allow you to send stuff to the SPI display.
For SPI there is also a beta kernel driver. That is what the other directory bw_spi is for.
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[lcd protocol 1.6]] (both I2C and SPI).
For reference: here are older versions of the document: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
14b380059f349f03e5848f676289df3938d15ab4
Lcd protocol 1.6
0
1613
2450
2013-01-10T08:24:59Z
Rew
3
Created page with " This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display. Addresses on the SPI and I2C bu..."
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[i2c versus spi]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1.
|-
| 0x09 || write up to 20 bytes for startupmessage line 2.
|-
| 0x0a || write up to 20 bytes for startupmessage line 3.
|-
| 0x0b || write up to 20 bytes for startupmessage line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
6e58cba53bca5e2f9d98bc82a4e2b8c40687f838
2451
2450
2013-01-10T08:33:31Z
Rew
3
/* examples */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[i2c versus spi]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1.
|-
| 0x09 || write up to 20 bytes for startupmessage line 2.
|-
| 0x0a || write up to 20 bytes for startupmessage line 3.
|-
| 0x0b || write up to 20 bytes for startupmessage line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
2f6fec4618be585342dea735abcf7a7b977dd63b
2452
2451
2013-01-10T08:54:07Z
Rew
3
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1.
|-
| 0x09 || write up to 20 bytes for startupmessage line 2.
|-
| 0x0a || write up to 20 bytes for startupmessage line 3.
|-
| 0x0b || write up to 20 bytes for startupmessage line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
bd338ff7bd355b988631e8e7968accf0188d3971
2453
2452
2013-01-10T08:54:41Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || > 1.5
|-
| 0x09 || write up to 20 bytes for startupmessage line 2.
|-
| 0x0a || write up to 20 bytes for startupmessage line 3.
|-
| 0x0b || write up to 20 bytes for startupmessage line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
4358f9bbe1a7dd3d07b92adc65d1a089e2dd8c53
2454
2453
2013-01-10T08:55:36Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
0cd3c2bc97270153d68c3146582546f90d027d15
Main Page
0
1
2459
2343
2013-01-11T16:21:35Z
Tom
4
/* General pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
cad6dcf2755a7a4ffa60defe96cf5c3b774e3d14
2479
2459
2013-01-23T16:59:55Z
Rew
3
/* How-to's */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
dcbe465bf4be5e85958ffda50855e1d288abacb9
Servo 1.0 protocol
0
126
2462
1188
2013-01-12T10:19:56Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
90b04f3c46e0f7ca87e5cbedb9a80c9fad0b9886
SPI connector pinout
0
87
2467
1064
2013-01-14T08:27:10Z
Rew
3
/* Connecting the BitWizard boards to an Arduino */
wikitext
text/x-wiki
For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable.
The pinout is the same (or very similar) to the pinout of the 6-pin ICSP programming connector that lots of AVR boards have.
{| border=1
! pin !! function !! remark
|-
| 1 || MISO || Master In Slave Out
|-
| 2 || VCC || power
|-
| 3 || SCK || Shift Clock
|-
| 4 || MOSI || Master Out Slave In.
|-
| 5 || SS || Slave Select
|-
| 6 || GND || Ground 0V
|-
|}
The connector is laid out as follows:
{| border=1
|-
| 1 || 2
|-
| 3 || 4
|-
| 5 || 6
|-
|}
The board usually has pin 1 and six marked.
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin
|-
| 1 || MISO || 12
|-
| 2 || VCC || 5V
|-
| 3 || SCK || 13
|-
| 4 || MOSI || 11
|-
| 5 || SS || 10
|-
| 6 || GND || Gnd
|-
|}
You could use other pins, but then you have to make a software SPI implementation. This is not too difficult, but might be neccesary if something else is already on the SPI pins. On the other hand, you might be able to still use the hardware SPI module by just moving the "SS" pin somewhere else.
== Connecting the BitWizard boards to a Raspberry pi ==
{| border=1
! pin !! function !! Raspberry pi P1 pin
|-
| 1 || MISO || 21 GPIO 9
|-
| 2 || VCC || 2,4 5V
|-
| 3 || SCK || 23 GPIO 11
|-
| 4 || MOSI || 19 GPIO 10
|-
| 5 || SS || 24 CE0 or 26 CE1
|-
| 6 || GND || 6, 9, 14,20,25 Gnd
|-
|}
You could use other pins, but then you have to make a software SPI implementation. This is not too difficult, but might be neccesary if something else is already on the SPI pins.
16e5d512c3a3b97090f4b82603d9b601a0b18abb
File:RPI Console pins.png
6
1624
2470
2013-01-16T11:08:33Z
Cmaxwell au
2443
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Raspberry Pi User Interface with 16 x 2 LCD with a console serial cable
0
1625
2471
2013-01-16T11:10:42Z
Cmaxwell au
2443
Created page with "I'm trying to connect a USB to TTL console cable via, as the user interface board is connected to the gpio port. I am using a revision b raspberry pi. The console cable manu..."
wikitext
text/x-wiki
I'm trying to connect a USB to TTL console cable via, as the user interface board is connected to the gpio port.
I am using a revision b raspberry pi.
The console cable manual show the following connection diagram:
[[File:RPI_Console_pins.png]]
I'm looking for pinouts for the breakouts so I can find if pins 6,8 10 have been broken out
ffc6b91dc44f30a7390eb4c8a15afbeab0c0d04a
2472
2471
2013-01-16T11:14:06Z
Cmaxwell au
2443
moved [[Raspberry Pi User Interface with 16 x 2 LCD]] to [[Raspberry Pi User Interface with 16 x 2 LCD with a console serial cable]]
wikitext
text/x-wiki
I'm trying to connect a USB to TTL console cable via, as the user interface board is connected to the gpio port.
I am using a revision b raspberry pi.
The console cable manual show the following connection diagram:
[[File:RPI_Console_pins.png]]
I'm looking for pinouts for the breakouts so I can find if pins 6,8 10 have been broken out
ffc6b91dc44f30a7390eb4c8a15afbeab0c0d04a
2474
2472
2013-01-16T11:33:31Z
Rew
3
wikitext
text/x-wiki
Connecting the rpi_ui to a USB to TTL console cable.
The console cable manual show the following connection diagram:
[[File:RPI_Console_pins.png]]
Our boards break out the uart pins on a 4-pin uart connector.
Here is a diagram (top view) of the rpi_ui. Even if it might show the 16x2, the 20x4 board has the pins in exactly the same order.
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
So to connect things up,
Connect the black GROUND connector to the GND pin. The one nearest the I2C connector.
connect the green RXD cable to the next pin and
Connect the white TXD cable to the third pin.
You can leave the red VCC connector unconnected.
b16ace6a9c1fe47eea50353418087345ea65e6b1
2475
2474
2013-01-16T11:34:02Z
Rew
3
wikitext
text/x-wiki
Connecting the rpi_ui to a USB to TTL console cable.
The console cable manual show the following connection diagram:
[[File:RPI_Console_pins.png]]
Our boards break out the uart pins on a 4-pin uart connector.
Here is a diagram (top view) of the rpi_ui. Even if it might show the 16x2, the 20x4 board has the pins in exactly the same order.
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
So to connect things up:
* Connect the black GROUND connector to the GND pin. The one nearest the I2C connector.
* Connect the green RXD cable to the next pin and
* Connect the white TXD cable to the third pin.
You can leave the red VCC connector unconnected.
57138fd1844fcb165f028e886629262876358c05
Raspberry Pi User Interface with 16 x 2 LCD
0
1626
2473
2013-01-16T11:14:06Z
Cmaxwell au
2443
moved [[Raspberry Pi User Interface with 16 x 2 LCD]] to [[Raspberry Pi User Interface with 16 x 2 LCD with a console serial cable]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi User Interface with 16 x 2 LCD with a console serial cable]]
1d9e77223fa0835f87dcee8e6a9dbab654a6958b
Installing and booting FriendlyArm mini6410
0
1630
2480
2013-01-23T17:10:53Z
Rew
3
Created page with " = the basics = This section explains how the S3C6410 processor boots. The processor has a boot rom, called "iROM" or "BL0" that is able to boot from two possible locations..."
wikitext
text/x-wiki
= the basics =
This section explains how the S3C6410 processor boots.
The processor has a boot rom, called "iROM" or "BL0" that is able to boot from two possible locations.
The iROM loads either the first 8k of NAND memory, or when told to boot SD, 8k of data from the SD card. The data loaded from the SD card is taken from "near the end" of the card. For the exact location see "Application Note (Internal ROM Booting) S3C6410X, july 24, 2008" from Samsung.
That 8k bootloader is sometimes called "BL1". It is loaded into a piece of SRAM inside the CPU. The code for this can be provided by "superboot".
This BL1 then initializes the SDRAM, and loads further bootloaders and/or the OS.
Superboot is able to read the first fat partition on the SD card, look into the /Images directory for a file called FriendlyARM.ini, and boot according to the instructions found therein.
Linux kernels are booted through a second stage bootloader called uboot. The binary (usually called uboot.bin) is usually stored in the Images directory or in a subdirectory thereof.
== FriendlyARM.ini ==
== kernel ==
== root filesystem ==
e9ac82acee3d6c559cb3cee4b71c6694b3178bcb
2483
2480
2013-01-24T12:52:58Z
Rew
3
/* FriendlyARM.ini */
wikitext
text/x-wiki
= the basics =
This section explains how the S3C6410 processor boots.
The processor has a boot rom, called "iROM" or "BL0" that is able to boot from two possible locations.
The iROM loads either the first 8k of NAND memory, or when told to boot SD, 8k of data from the SD card. The data loaded from the SD card is taken from "near the end" of the card. For the exact location see "Application Note (Internal ROM Booting) S3C6410X, july 24, 2008" from Samsung.
That 8k bootloader is sometimes called "BL1". It is loaded into a piece of SRAM inside the CPU. The code for this can be provided by "superboot".
This BL1 then initializes the SDRAM, and loads further bootloaders and/or the OS.
Superboot is able to read the first fat partition on the SD card, look into the /Images directory for a file called FriendlyARM.ini, and boot according to the instructions found therein.
Linux kernels are booted through a second stage bootloader called uboot. The binary (usually called uboot.bin) is usually stored in the Images directory or in a subdirectory thereof.
== FriendlyARM.ini ==
explain syntax here.
== kernel ==
== root filesystem ==
e408eb424e21109cfb6bf724543f6607d8eaf320
Bw tool
0
1635
2486
2013-01-26T14:06:01Z
Rew
3
Created page with "= intro = The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work o..."
wikitext
text/x-wiki
= intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= basic example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= options =
== options specifying the device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. This second i2c bus is the one that is broken out on the gpio's of rev2 raspberry pi's.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== options sending data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== reading data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== finer control ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that bitwizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
bad673fbba1aa63680e3ceeab559ac68e414712b
2491
2486
2013-02-03T19:16:24Z
Bronte
2451
wikitext
text/x-wiki
= intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= installation/compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Each folder contains a make file, so using the command
''make''
should work fine.
= basic example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= options =
== options specifying the device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. This second i2c bus is the one that is broken out on the gpio's of rev2 raspberry pi's.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== options sending data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== reading data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== finer control ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that bitwizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
60514ca6a08ac7d7f83aa76d16be59b5a7f0a2cd
User Interface
0
1505
2493
2492
2013-02-03T19:26:14Z
Bronte
2451
/* examples */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
42256ccb99802545726c69c0d9b804b3d4093ec7
2525
2493
2013-03-27T06:41:42Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line.
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f8caa0fcc6f4947a58d7833a6c200cd2c27c244a
2562
2525
2013-05-17T10:51:52Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
10472a390aa737ac154039d33d983587acd5fdf7
2563
2562
2013-05-17T10:57:02Z
Rew
3
/* read ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f59dac50684eb98fd58fc2cc821f0d074126afb1
2564
2563
2013-05-17T11:00:13Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
6299a63823f81273d220272bb6f0bacaf190468f
Talk:User Interface
1
1639
2494
2013-02-03T19:28:40Z
Bronte
2451
Created page with "This article prolly needs some more examples. Maybe its also a good idea to move the I2C rasbian config things to a seperate I2C article."
wikitext
text/x-wiki
This article prolly needs some more examples. Maybe its also a good idea to move the I2C rasbian config things to a seperate I2C article.
ce0cc125a0fe68ba6959bad3cafde16005f5534e
2495
2494
2013-02-03T19:29:04Z
Bronte
2451
wikitext
text/x-wiki
This article prolly needs some more examples. Maybe its also a good idea to move the I2C rasbian config things to a seperate I2C article. --Bronte
605abe86235aa93356b2db68596e9e8e775d1ab5
Default addresses
0
484
2500
2415
2013-02-07T10:29:36Z
Rew
3
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| LCD || 0x82
|-
| DIO || 0x84
|-
| SERVO || 0x86
|-
| 7FETs || 0x88
|-
| 3FETs || 0x8A
|-
| TEMP (sometimes called SPI_LM35) || 0x8C
|-
| RELAY || 0x8E
|-
| motor || 0x90
|-
| pipower || 0x92
|-
| RPi_UI || 0x94
|-
| 7segment || 0x96
|-
| spi_spi || 0x98
|-
| pushbutton || 0x9A
|-
| bigrelay || 0x9C
|-
| || 0x9E
|-
| thermo || 0xa0
|-
| ... || 0xA2
|}
f6bb7e925aa46782a7116886725a95b79a838e18
Relay
0
53
2501
2345
2013-02-07T10:39:27Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a9c8760577481161cf7f84641dd0df72f7781f25
2557
2501
2013-05-15T13:12:15Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
3 - +5V from SPI/I2C
2 - 5V for the relays
1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
265c9583e4c6dc3abfe0288ed4d2ab229ad82bea
2558
2557
2013-05-15T13:15:09Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
3 - +5V from SPI/I2C
2 - 5V for the relays
1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f29e3880d2f11130b8b8343b3d1f425c9173d07a
2559
2558
2013-05-15T13:15:43Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f1dadd8242eb69b642df673886da4f2e3d640463
LCD
0
716
2502
2449
2013-02-11T09:00:20Z
Rew
3
/* Additional software */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
The contrast setting depends strongly on the voltage of the power line. We test the boards with our powersupply and deliver them with a contrast setting that works for us. However if your powersupply has a higher or lower voltage, the proper contrast setting might be different.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with the raspberry pi use the bw_rpi_tools package (and then only the bw_tool program) from github: [[https://github.com/rewolff/bw_rpi_tools]]
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[lcd protocol 1.6]] (both I2C and SPI).
For reference: here are older versions of the document: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
0bc8cb9f4a5c1a979622302235c367b2aef58f9f
2503
2502
2013-02-11T09:02:42Z
Rew
3
/* Additional software */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards.
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
The contrast setting depends strongly on the voltage of the power line. We test the boards with our powersupply and deliver them with a contrast setting that works for us. However if your powersupply has a higher or lower voltage, the proper contrast setting might be different.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with the raspberry pi use the [https://github.com/rewolff/bw_rpi_tools bw_rpi_tools package from github](and then only the bw_tool program).
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[lcd protocol 1.6]] (both I2C and SPI).
For reference: here are older versions of the document: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
fcfce8ced605eff52166dfde1a74bf2d3ee15170
DIO
0
52
2504
2297
2013-02-11T13:45:07Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as analog inputs!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
77fe36d4ad246a2fa7dd93e3825effbc36787fb8
7 Segment
0
1556
2505
2284
2013-02-19T16:27:31Z
Rew
3
/* The software */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
There are no LEDs, except for the display of course.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny48 on the board.
== Programming ==
== The software ==
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x10 || Write a bitmap to the display (see [[#bitmap]]) (4 bytes)
|-
| 0x11 || Write a hexadecimal number to the display (4 bytes)
|-
| 0x20 .. 0x23 || Write a bitmap to only 1 character
|-
| 0x30 .. 0x33 || Write a hexadecimal numer to only 1 character
|-
| 0x40 || Write a value other then 0x00 to light the bottom dot, 0x00 turns it off.
|-
| 0x41 || Write a value other then 0x00 to light the upper dot, 0x00 turns it off.
|-
| 0x42 || Write a value other then 0x00 to light both dots, 0x00 turns them off.
|-
| 0xf0 || change address.
|}
=== read ports ===
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || Return the entire bitmap (see [[#bitmap]]) (4 bytes)
|-
| 0x20 .. 0x23 || Return the bitmap of 1 character
|}
=== Bitmap ===
It is possible to tell the module to not show a hexadecimal digit, bit to display a user-defined digit.<br>
The most significant bit in this bitmap controls segment A, and the least significant bit controls one of the dots. The lower dot is controlled by digit 2, and the upper dot by digit 3.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
29c56fc838560c1c5e523c0fc95fddfa745a957f
2506
2505
2013-02-19T16:29:58Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
There are no LEDs, except for the display of course.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny48 on the board.
== Programming ==
== The software ==
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x10 || Write a bitmap to the display (see [[#bitmap]]) (4 bytes)
|-
| 0x11 || Write a hexadecimal number to the display (4 bytes)
|-
| 0x12 || write 0x01 to store the current display as startup display. Write 0x00 to return to the default.
|-
| 0x20 .. 0x23 || Write a bitmap to only 1 character
|-
| 0x30 .. 0x33 || Write a hexadecimal numer to only 1 character
|-
| 0x40 || Write a value other then 0x00 to light the bottom dot, 0x00 turns it off.
|-
| 0x41 || Write a value other then 0x00 to light the upper dot, 0x00 turns it off.
|-
| 0x42 || Write a value other then 0x00 to light both dots, 0x00 turns them off.
|-
| 0xf0 || change address.
|}
=== read ports ===
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || Return the entire bitmap (see [[#bitmap]]) (4 bytes)
|-
| 0x20 .. 0x23 || Return the bitmap of 1 character
|}
=== Bitmap ===
It is possible to tell the module to not show a hexadecimal digit, bit to display a user-defined digit.<br>
The most significant bit in this bitmap controls segment A, and the least significant bit controls one of the dots. The lower dot is controlled by digit 2, and the upper dot by digit 3.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
d6e9b90123a07520e63dd25176a6a3fc982d65cc
2507
2506
2013-02-19T16:31:07Z
Rew
3
/* Bitmap */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
There are no LEDs, except for the display of course.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny48 on the board.
== Programming ==
== The software ==
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x10 || Write a bitmap to the display (see [[#bitmap]]) (4 bytes)
|-
| 0x11 || Write a hexadecimal number to the display (4 bytes)
|-
| 0x12 || write 0x01 to store the current display as startup display. Write 0x00 to return to the default.
|-
| 0x20 .. 0x23 || Write a bitmap to only 1 character
|-
| 0x30 .. 0x33 || Write a hexadecimal numer to only 1 character
|-
| 0x40 || Write a value other then 0x00 to light the bottom dot, 0x00 turns it off.
|-
| 0x41 || Write a value other then 0x00 to light the upper dot, 0x00 turns it off.
|-
| 0x42 || Write a value other then 0x00 to light both dots, 0x00 turns them off.
|-
| 0xf0 || change address.
|}
=== read ports ===
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || Return the entire bitmap (see [[#bitmap]]) (4 bytes)
|-
| 0x20 .. 0x23 || Return the bitmap of 1 character
|}
=== Bitmap ===
It is possible to tell the module to not show a hexadecimal digit, but to display a user-defined digit.<br>
The most significant bit in this bitmap controls segment A, and the least significant bit controls one of the dots. The lower dot is controlled by digit 2, and the upper dot by digit 3.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5cea721a22d284d1f839c10d6ab9d5590b3f9781
File:Rpi serial.jpg
6
58
2517
313
2013-03-22T17:08:28Z
Tom
4
uploaded a new version of "[[File:Rpi serial.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Field-upgrade bitwizard boards
0
1651
2522
2013-03-26T11:36:37Z
Rew
3
Created page with " If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done.... Get the modified avrdude binary fro..."
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work.
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
of course substituting the name hexfile that we sent you.
6d1f8d176dc015221b85437c08717f2227e9b9f0
2523
2522
2013-03-26T12:27:31Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work.
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
of course substituting the name hexfile that we sent you.
for the devices with atmega328 parts, you will need to add the definition of the mega328 to your /etc/avrdude.conf file:
part parent "m328p"
id = "m328";
desc = "ATmega328";
signature = 0x1e 0x95 0x14;
;
just below the definition of the ATmega328p . ... XXX ad lineno, xxx add link to complete file... XXX add link to fixed ".deb" file.
c087341170174d9aaf21b1a550b727002342d9d0
2534
2523
2013-04-18T10:58:42Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work.
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
of course substituting the name hexfile that we sent you.
for the devices with atmega328 parts, you will need to add the definition of the mega328 to your /etc/avrdude.conf file:
part parent "m328p"
id = "m328";
desc = "ATmega328";
signature = 0x1e 0x95 0x14;
;
just below the definition of the ATmega328p . ... XXX ad lineno, xxx add link to complete file... XXX add link to fixed ".deb" file.
After flashing you will have reset the eeprom. It is cleared with the main flash. Thus any values saved in the eeprom like the serial number, contrast settings and startup texts will have been wiped. We hope to upgrade the procedure soon to be able to restore them.
1ce5b915c563cb1f0b8bb006ed875cd2e1c97c92
Spi lcd 1.3 protocol
0
112
2524
2440
2013-03-27T06:41:07Z
Rew
3
/* write ports */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line.
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
0fe5a27cd28ea4b6c8d82f8a8c895caa0c1f4465
2560
2524
2013-05-16T12:41:07Z
Leelassen
2472
/* define custom character */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line.
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1" (Up to 8 characters can be defined in CGRAM).
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
Getting back to display mode (DDRAM) and moving to home position (address 0) can also be done by sending: "82 01 80"
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
d434208bfa289d6ec898ef5f5bc5a2e9314626f2
2561
2560
2013-05-16T12:48:44Z
Leelassen
2472
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line.
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1" (Up to 8 characters can be defined in CGRAM).
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
Getting back to display mode (DDRAM) and moving to home position (address 0) can also be done by sending: "82 01 80"
== Showing a cursor/blinking cursor ==
Show cursor position:
82 01 0E # cursor on
82 01 0C # cursor off
Blinking (current position):
82 01 0D #blink on
82 01 0C #blink off
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
21bec0ce2f88d1c0faa44e0f7b0bb6a231ea3e41
Main Page
0
1
2526
2479
2013-03-27T15:32:37Z
Tom
4
/* General pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
58042e6bc7ff943af9c718651fa810cf62397f49
2533
2526
2013-04-10T13:38:08Z
Tom
4
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
65711f455b2c386e631662dfca918cec3c843fcc
Rtc
0
1652
2527
2013-03-27T15:36:08Z
Tom
4
Created page with "Load the I2C and RTC drivers as root: modprobe i2c-dev modprobe i2c:mcp7941x echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device To write the system time to th..."
wikitext
text/x-wiki
Load the I2C and RTC drivers as root:
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.d/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
hwclock -s
4d0e91a4dc469800882f716c71c0ece24dfb1e1e
2528
2527
2013-03-27T15:37:20Z
Tom
4
wikitext
text/x-wiki
Load the I2C and RTC drivers as root:
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.d/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device
hwclock -s
Source: http://www.element14.com/community/message/63885
ca82899d5a7dd6073726c459772ee5d339e10c93
2532
2528
2013-04-10T13:37:42Z
Tom
4
wikitext
text/x-wiki
Load the I2C and RTC drivers as root:
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device // For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device // For rev2 RPi
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.d/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device // For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device // For rev2 RPi
hwclock -s
Source: http://www.element14.com/community/message/63885
4a502f28c39b58dca26d1b95f6c5867de768cfa7
DIO protocol
0
432
2530
2434
2013-03-29T15:59:03Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits)
|-
| 0x41 || X || X || || || set target position. (32 bits)
|-
| 0x42 || X || X || || || set relative position. (32 bits)
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
21139ef4520c07306a98fde6f0b3e58bd381d9f5
2531
2530
2013-03-29T16:18:58Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
22476d640677eafcf2f31867a7ad3e79dea31964
Analog inputs
0
1593
2536
2438
2013-04-19T07:40:26Z
Rew
3
/* normal measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 7 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x28 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x2a || 0x2e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
73745b369063245b1fe5157109265b45d5a13ee7
2537
2536
2013-04-19T07:40:38Z
Rew
3
/* normal measurements */
wikitext
text/x-wiki
= analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x28 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x2a || 0x2e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
a5722de1aa8892c17c3f39c720543b927c9961a3
16 LEDs
0
54
2538
317
2013-04-24T15:32:30Z
Arnold
2467
/* Pinout */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
== Assembly instructions ==
=== Possible Configurations ===
== External resources ==
=== Related projects ===
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
25abccca4ba4e7e11da8d095ec89aded021daebf
2539
2538
2013-04-24T15:34:08Z
Arnold
2467
/* Assembly instructions */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
== External resources ==
=== Related projects ===
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
36e9fcfb6124c60e1d02122afca6d065da7f38e6
2540
2539
2013-04-24T15:37:22Z
Arnold
2467
/* Overview */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
== External resources ==
=== Related projects ===
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
d41b085e51c30e89eb1b4a42dbbe62eaf6e77053
2541
2540
2013-04-24T15:44:48Z
Arnold
2467
/* Possible Configurations */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the power pins on the boards.
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
4a06cb0a68eff994d33b5a36466a06cabf66d641
2542
2541
2013-04-24T15:45:16Z
Arnold
2467
/* Possible Configurations */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
1d266fca4eddb69c9dbaf62391960cf228e859c1
2543
2542
2013-04-24T15:46:23Z
Arnold
2467
/* Related projects */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
385bae8c4aabc1f2e5666afce4f8b7a7c446e694
2544
2543
2013-04-24T15:47:16Z
Arnold
2467
/* Possible Configurations */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.<br>
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
f38e494d69e0cb12cb0cb05cad8ff401e56f8220
2545
2544
2013-04-24T16:00:25Z
Arnold
2467
/* Overview */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.<br>
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED1 || LED2
|-
| 5 || 6 || LED3 || LED4
|-
| 7 || 8 || LED5 || LED6
|-
| 9 || 10 || LED7 || LED8
|-
| 11 || 12 || LED9 || LED10
|-
| 13 || 14 || LED11 || LED12
|-
| 15 || 16 || LED13 || LED14
|-
| 17 || 18 || LED15 || LED16
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
a901e47942aedd006bbf6efff27dca80529960aa
2546
2545
2013-04-24T16:02:45Z
Arnold
2467
/* Pinout */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.<br>
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Jumper settings ==
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
42a160e8d928685f18ccfcc3eb5bacb711850927
2547
2546
2013-04-24T16:03:16Z
Arnold
2467
/* Jumper settings */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.<br>
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
604152ec39344c9226fa763614eaf45befb9f477
2548
2547
2013-04-24T16:03:40Z
Arnold
2467
/* Pinout */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.<br>
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
== Jumper settings ==
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC</td></tr>
</table>
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
a267506080eab6fd1b1979e39b6b38a51218d297
2549
2548
2013-04-25T07:51:54Z
Arnold
2467
/* Jumper settings */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.<br>
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
== Jumper settings ==
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND / kathode</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC / anode</td></tr>
</table>
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
9c0f517ea0fe9178d19e5dd15cf50128bc237605
2550
2549
2013-04-25T14:23:38Z
Rew
3
/* Overview */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards (e.g. i2c_dio or spi_dio). Or if your board has a 10x2 pin header, you can use a 20pin IDC cable.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
To test the 16LED, connect the device to any of the GND and power pins on the boards.<br>
For example if you have a combination of the DIO and the 16LED (common GND), connect DIO-PIN1 to 16LED-PIN1 and DIO-PIN2 to 16LED-<b>PIN3</b> to light LED0 as DIO-PIN2 is VCC (5V).
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
== Jumper settings ==
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND / kathode</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC / anode</td></tr>
</table>
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
aa7de766563a69266643c3a5f978c012d36f55ed
2551
2550
2013-04-25T14:31:58Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards (e.g. i2c_dio or spi_dio). Or if your board has a 10x2 pin header, you can use a 20pin IDC cable.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
The 16-leds board can be ordered in two versions. The common-anode version will connect all the anodes to VCC (pin 19,20) and the leds via a resistor to the 16 inputs (pin 3-18). This means that the led will light up if you drive the input pin (3-19) LOW. This is useful for open collector outputs. However usually this results in inverted logic: the led lights when the signal is low.
Most people will want the common-cathode version. This connects all the cathodes to GND (pin 1/2) and then all the inputs to the leds. This results in normal logic: the leds light up if the signal is high.
=== testing ===
To test the 16LED, connect the GND (pin 1 or 2) to any of the GND pins on your board.
Next take a 5V (or 3.3V) wire (pin 2 on DIO) and connect it one at a time to pin 3, 4, and so on. You can use a power supply pin or a pin programmed to "high". Each time you touch one of the inputs, one of the leds should light up.
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
== Jumper settings ==
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND / kathode</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC / anode</td></tr>
</table>
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Initial public release
816eb2791ff53081378da281ff959c55de789655
2552
2551
2013-04-25T14:34:37Z
Rew
3
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board.
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards (e.g. i2c_dio or spi_dio). Or if your board has a 10x2 pin header, you can use a 20pin IDC cable.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
The 16-leds board can be ordered in two versions. The common-anode version will connect all the anodes to VCC (pin 19,20) and the leds via a resistor to the 16 inputs (pin 3-18). This means that the led will light up if you drive the input pin (3-19) LOW. This is useful for open collector outputs. However usually this results in inverted logic: the led lights when the signal is low.
Most people will want the common-cathode version. This connects all the cathodes to GND (pin 1/2) and then all the inputs to the leds. This results in normal logic: the leds light up if the signal is high.
=== testing ===
To test the 16LED, connect the GND (pin 1 or 2) to any of the GND pins on your board.
Next take a 5V (or 3.3V) wire (pin 2 on DIO) and connect it one at a time to pin 3, 4, and so on. You can use a power supply pin or a pin programmed to "high". Each time you touch one of the inputs, one of the leds should light up.
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
== Jumper settings ==
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND / kathode</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC / anode</td></tr>
</table>
== Future hardware enhancements ==
The jumper is not much use: If you have the common cathode version the jumper must connect the common rail to GND, and if you have the common anode version, you must connect it to VCC. Therefore it makes more sense to make this a solder-jumper. It makes sense to design the board to have the GND signal the default because most people will want the normal-logic version i.e. the common cathode.
== Changelog ==
=== 2.0 ===
* Initial public release
1f4234bf92aac5aa6fdb74810bc05c8e28b60a4d
Dio breakout
0
1659
2565
2013-05-17T13:18:24Z
Rew
3
Created page with "[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]] This is the documentation page for the DIO_breakout . == Overview == This board en..."
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
[[DIO]]
== Pinout ==
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
== jumper settings ==
There are no jumpers.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
286ccf10d709536202b3a6b45ac41cdc3ed346d6
Dio breakout
0
1659
2566
2565
2013-05-17T13:19:41Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
== jumper settings ==
There are no jumpers.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ab9cde621ea46ecfdf708c06fcc927c07f45ba55
2567
2566
2013-05-17T13:19:58Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
== Additional software ==
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
== jumper settings ==
There are no jumpers.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
dc9d2d5484e624343cb47a0371ee2f355a843d23
2568
2567
2013-05-17T13:20:09Z
Rew
3
/* External resources */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
== Additional software ==
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
== jumper settings ==
There are no jumpers.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
e708f16d1b242ed10ac5cbd9c740dde8c5ef94e5
2569
2568
2013-05-17T13:20:17Z
Rew
3
/* Additional software */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
== jumper settings ==
There are no jumpers.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f0c3becfa99ce6170afff09aed050c9a660c7c91
2570
2569
2013-05-17T13:22:45Z
Rew
3
/* jumper settings */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
== jumper settings ==
There are no jumpers.
== configurations ==
You can chose to have your board equipped with a 10-pin female connector that allows your board to directly fit on top of the I2C-DIO board. This would conflict with the SPI connectors so don't chose this option for an SPI_DIO.
You can chose to have your board equipped with a male 10-pin connector that allows you to connect your board with the SPI_DIO or I2C DIO using a short 10pin IDC cable.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
b89e73182e601b1320ce5edad3e8b69920dabaf0
2571
2570
2013-05-17T13:22:54Z
Rew
3
/* configurations */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
== jumper settings ==
There are no jumpers.
== configurations ==
You can chose to have your board equipped with a 10-pin female connector that allows your board to directly fit on top of the I2C-DIO board. This would conflict with the SPI connectors so don't chose this option for an SPI_DIO.
You can chose to have your board equipped with a male 10-pin connector that allows you to connect your board with the SPI_DIO or I2C DIO using a short 10pin IDC cable.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
6454e79cbd393a7563da3a2f7b02754a88803fdc
2572
2571
2013-05-17T13:24:09Z
Rew
3
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
== jumper settings ==
There are no jumpers.
== configurations ==
You can chose to have your board equipped with a 10-pin female connector that allows your board to directly fit on top of the I2C-DIO board. This would conflict with the SPI connectors so don't chose this option for an SPI_DIO.
You can chose to have your board equipped with a male 10-pin connector that allows you to connect your board with the SPI_DIO or I2C DIO using a short 10pin IDC cable.
== Future hardware enhancements ==
may 2013: This is vaporware: hardware will be available june 2013.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
42f7a4e51264f72e550f669f8851f6a7d0d9a444
Field-upgrade bitwizard boards
0
1651
2573
2534
2013-05-18T21:05:33Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work.
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
of course substituting the name hexfile that we sent you.
for the devices with atmega328 parts, you will need to add the definition of the mega328 to your /etc/avrdude.conf file:
part parent "m328p"
id = "m328";
desc = "ATmega328";
signature = 0x1e 0x95 0x14;
;
just below the definition of the ATmega328p . ... XXX ad lineno, xxx add link to complete file... XXX add link to fixed ".deb" file.
After flashing you will have reset the eeprom. It is cleared with the main flash. Thus any values saved in the eeprom like the serial number, contrast settings and startup texts will have been wiped. We hope to upgrade the procedure soon to be able to restore them.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
f803a37261e2a1151bae24bd48e0b8926f21019e
2586
2573
2013-05-31T10:53:11Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work.
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
of course substituting the name hexfile that we sent you.
for the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc .
After flashing you will have reset the eeprom. It is cleared with the main flash. Thus any values saved in the eeprom like the serial number, contrast settings and startup texts will have been wiped. We hope to upgrade the procedure soon to be able to restore them.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
7f84cc5ea03cc4c6272ca9d1a92f518502441be7
2594
2586
2013-06-12T09:16:22Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work.
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U flash:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
700aa93ba44c5c3286c8658715ca2125146bd3db
2661
2594
2013-08-19T06:50:50Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem.
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U flash:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
3b04f5d6319c7115fdfaa1cb6a7f1e799dbe9718
Motor
0
658
2574
2302
2013-05-24T10:55:19Z
Rew
3
/* Jumper */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 10V to 14V power supply. Please refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2
|-
| >14V || Jumper on pins 2 and 3
|}
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
3734c42ac5fb9147cb8c38c1a2270e35636a747b
2575
2574
2013-05-24T11:02:57Z
Rew
3
/* Jumper */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board.
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 10V to 14V power supply. Please refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2. The motor voltage is used to drive the FETs
|-
| >14V || Jumper on pins 2 and 3. The onboard regulator generates 12V from the motor voltage.
|}
If a FET is built to use 12V gate voltages, it will only conduct partially when you drive it with lower voltages. The FET would run hot or self-destruct very quickly if that happens. So to prevent this from happening the FET-driver will not drive the FET at all if the gate-drive-voltage is not above 8V. That is why even if your motor runs on 5V you cannot use 5V for the gate-drive-voltage.
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
b5bdf69924cfd83e101172941a36d3680452243d
Motor protocol
0
657
2576
1347
2013-05-24T11:27:25Z
Rew
3
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
56289058a8f29e9d56933b6901da64bd2179d708
2601
2576
2013-07-04T11:52:02Z
Rew
3
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
0581e30aeb87dfe768525d4403d1b787cb934176
2604
2601
2013-07-04T11:53:18Z
Rew
3
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
a14ab95a54158061c4127f862940c232ffb7e3b1
Pushbutton
0
1557
2577
2290
2013-05-24T13:24:08Z
Rew
3
/* read ports */
wikitext
text/x-wiki
[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]]
This is the documentation page for the pushbutton boards.
== Overview ==
This board adds 4 pushbuttons to your I2C or SPI enabled device.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI0 into an ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
|-
| 0xf0 || change address.
|}
=== read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all buttons
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
039fc1222fd5f5aacf856ec0e2f8ec757c9b45f3
DIO
0
52
2578
2504
2013-05-24T14:04:55Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as analog inputs!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! analog?
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0 || yes
|-
| 4 || IO1 || no
|-
| 5 || IO2 || no
|-
| 6 || IO3 || yes
|-
| 7 || d.n.c.
|-
| 8 || IO4 ||yes
|-
| 9 || IO5 ||no
|-
| 10 || IO6 ||yes
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
83147a70c2e79318aaddaf951490c793e9d8d94e
2579
2578
2013-05-24T14:10:54Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write upto 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as analog inputs!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! analog?
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0 || yes
|-
| 4 || IO1 || yes
|-
| 5 || IO2 || no
|-
| 6 || IO3 || yes
|-
| 7 || d.n.c.
|-
| 8 || IO4 ||yes
|-
| 9 || IO5 ||no
|-
| 10 || IO6 ||yes
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
b13d11dc1eba9f133d4178e5e6b0e1b3f7fc7c06
DIO protocol
0
432
2580
2531
2013-05-29T11:46:19Z
Rew
3
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: From version 1.5 on.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
b4db99d3d573eca64a738eddd6b531b4a1cf5c8d
2581
2580
2013-05-29T11:46:48Z
Rew
3
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
e1ccd0eabf13eaa8c29d0e15349bc4958d31655f
2582
2581
2013-05-29T13:27:21Z
Rew
3
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
2e817a05814f09e431fa8da8cf883c873134bd7d
2600
2582
2013-07-04T11:51:35Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
33cf3d9572731a65d2e0bcde795d8f539800aafb
2669
2600
2013-09-19T05:53:09Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default adresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
2b3464d0e769fe3f3779c005fa3dc9e3d3a59b7b
I2c addresses
0
1660
2583
2013-05-31T09:33:22Z
Rew
3
Created page with "The I2C protocol is a bus protocol. Multiple devices can be connected. Usually several slaves and one master. To be able to use several slave devices each slave has an address..."
wikitext
text/x-wiki
The I2C protocol is a bus protocol. Multiple devices can be connected. Usually several slaves and one master. To be able to use several slave devices each slave has an address. To be able to distinguish between read and write one bit is used, leaving 7 bits to separate slaves from each other.
There are two logical choices for the position of the read/write bit. You can put it at the left in the highest bit. This would mean you would use say 0x17 to read and 0x97 to write to a single device. This approach was not chosen. The read/write bit was chosen to be the lowest bit. 0x94 and 0x95 are write and read bytes to send for a single slave.
BitWizard has chosen to say that the slave has address 0x94 in this case. Just use that byte to address the device in write mode and add one to address it in read mode. We prefer to do it this way because there is now a clear and easy-to-do-in-your-head way go from an address to the byte-on-the-wire.
Other manufacturers and software-writers have chosen to display just the seven address bits. That means that the byte-on-the-wire is divided by two to get what they call "the address". For example a program like i2cdetect will display addresses this way. So the bitwizard address 0x94 will display as 0x4a in i2cdetect.
So when an rpi_ui starts up and displays "A: 94" it is exactly the same address as when i2cdetect shows a device at address 0x4a.
5b46a68ea3c7f189d79516c38d9f8716a896748c
File:Pic 4762 640.jpg
6
1661
2584
2013-05-31T09:43:50Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Assembling the rpi+rpi ui case.
0
1662
2585
2013-05-31T09:59:18Z
Rew
3
Created page with " [[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]] To assemble your rpi+rpi_ui case you the following procedure is the easiest. Use the screws, th..."
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the bolt, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. Now the case is starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
dbf14ac1a75b5e6208cc7db788bd5e2a677ffd5f
2588
2585
2013-06-03T18:59:28Z
Rew
3
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. Now the case is starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
bc5dc0a582960c49f05f18abb7f802a582826e17
2589
2588
2013-06-03T19:02:00Z
Rew
3
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case which has the HDMI connector cutout. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. Now the case is starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
fd7f2b8d7c15840b2c626e02136000055813208f
2590
2589
2013-06-03T19:04:29Z
Rew
3
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case which has the HDMI connector cutout. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. I recommend that you don't tighten the screws all the way. This allows for some play during the rest of the assembly. But even then, the case is already starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
9fc15b4d495eb3adc868b15a7adf6919bd622fde
2591
2590
2013-06-03T19:04:56Z
Rew
3
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case which has the HDMI connector cutout. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. I recommend that you don't tighten the screws all the way. This allows for some play during the rest of the assembly. But even then, the case is already starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
Now you can finish tightening all the screws.
615aba22d9d315590405d13ac79a733bf0859ea3
User Interface
0
1505
2587
2564
2013-05-31T11:29:14Z
Rew
3
/* I2C */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address.
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
1b1cf132d3cb00040c0a0856343a7b013a46d2b0
2665
2587
2013-08-23T15:39:01Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
25cdd9ab13aeeb93b856569ce13c313a17c2262f
2666
2665
2013-08-24T05:58:36Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
1b0f0202bcfee10452b5629a044094181fabc13b
Bitwizard LCD with LCDPROC
0
1663
2592
2013-06-05T11:16:33Z
Rew
3
Created page with "lcdproc has support for I2C LCDs but not (by default) for the bitwizard I2C LCDs. Mark Webb got it to work. Download his source tree from: http://prive.bitwizard.nl/lcdproc.zip"
wikitext
text/x-wiki
lcdproc has support for I2C LCDs but not (by default) for the bitwizard I2C LCDs.
Mark Webb got it to work. Download his source tree from: http://prive.bitwizard.nl/lcdproc.zip
e32c59e49459935b08ccca7a1bee1d6e1c091987
Main Page
0
1
2595
2533
2013-06-14T13:33:56Z
Tom
4
/* Kits */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extensioon kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
35824bb4ba1caed1fffe0e6548fde41506a6169b
2596
2595
2013-06-14T13:34:13Z
Tom
4
/* Kits */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
5bffa562484f4c18b12098b2d76137d0f19440c2
Raspberry Pi camera extension kit
0
1665
2597
2013-06-14T13:37:49Z
Tom
4
Created page with "Coming soon..."
wikitext
text/x-wiki
Coming soon...
eaee1c01b01f33883d55e53a4d8f69bafc995c34
2598
2597
2013-06-14T14:15:00Z
Tom
4
wikitext
text/x-wiki
= Connecting everything =
This is very straightforward:
- Turn off your Raspberry Pi
- Connect the same-side FPC cable to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi"
- Connect the opposite side FPC cable to the camera module, and the adapter board labeled "Camera board"
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards
And you're done!
69660faf2f7e72aabf18f2be1780a9086a28fa9d
2599
2598
2013-06-14T14:16:43Z
Tom
4
/* Connecting everything */
wikitext
text/x-wiki
= Connecting everything =
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the same-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi"<br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
f1b2ecdca01f38863bccb428dcd4950f9f0945d9
2634
2599
2013-07-19T14:23:31Z
Tom
4
/* Connecting everything */
wikitext
text/x-wiki
= Connecting everything =
== Shipped after 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi"<br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
== Shipped BEFORE 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on the same side of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the same-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi"<br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
34fcb77a2792880c04736e6ad137f51c76686010
Lcd protocol 1.6
0
1613
2602
2454
2013-07-04T11:52:31Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
b385ca3a2eed402ce9cafd031593811b6ff5b896
2603
2602
2013-07-04T11:52:52Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
c980105a51527b1f531279578fb7aee8866dee3d
2605
2603
2013-07-04T15:41:20Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances.
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
4b272c9e82ce60b6c7c6f30d7c5f21f601f08be9
2608
2605
2013-07-06T20:11:28Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data. Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances.
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
700fc73b048ad76eb60aeee175e64c8ce60df2e0
2609
2608
2013-07-06T20:11:46Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.<br>Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances.
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
ee10c81dc0cc0b168ad74d6916166cee12f0ccb5
I2c lcd protocol
0
620
2606
1070
2013-07-04T15:43:05Z
Rew
3
wikitext
text/x-wiki
= outdated =
This page is outdated. Please use the [Lcd_protocol_1.6] page.
== ----- old info follows: ----- ==
The addresses on the I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the I2C bus starts with the address of the board. The i2c_lcd board will ignore any transactions on the I2C bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general I2C protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The i2c_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('i2c_lcd 1.4').
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE.
|-
| 0x01 || identify port
|-
| STOP || create a STOP condition on the bus.
|-|-
| START || create a START condition on the bus.
|-
| 0x83 || select destination with address 0x82 for READ
|-
| 0x69 || 'i'
|-
| 0x32 || '2'
|-
| 0x63 || 'c'
|-
| ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent || explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x00 || datastream
|-
| 0x48 || 'H'
|-
| 0x65 || 'e'
|-
| 0x6c || 'l'
|-
| 0x6c || 'l'
|-
| 0x6f || 'o'
|-
| xx || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x11 || port 0x11 = set cursor position.
|-
| 0x25 || 0x25 = 001 00101 = line 1 position 5.
|-
| STOP || create a STOP condition on the bus.
|-
|}
718987b9b2a5b8623dae9f8fd4975496df242a90
2607
2606
2013-07-04T15:43:17Z
Rew
3
/* outdated */
wikitext
text/x-wiki
= outdated =
This page is outdated. Please use the [[Lcd_protocol_1.6]] page.
== ----- old info follows: ----- ==
The addresses on the I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the I2C bus starts with the address of the board. The i2c_lcd board will ignore any transactions on the I2C bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general I2C protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0xf0 || change address.
|}
= read ports =
The i2c_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('i2c_lcd 1.4').
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE.
|-
| 0x01 || identify port
|-
| STOP || create a STOP condition on the bus.
|-|-
| START || create a START condition on the bus.
|-
| 0x83 || select destination with address 0x82 for READ
|-
| 0x69 || 'i'
|-
| 0x32 || '2'
|-
| 0x63 || 'c'
|-
| ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent || explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x00 || datastream
|-
| 0x48 || 'H'
|-
| 0x65 || 'e'
|-
| 0x6c || 'l'
|-
| 0x6c || 'l'
|-
| 0x6f || 'o'
|-
| xx || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! explanation
|-
| START || create a START condition on the bus.
|-
| 0x82 || select destination with address 0x82 for WRITE
|-
| 0x11 || port 0x11 = set cursor position.
|-
| 0x25 || 0x25 = 001 00101 = line 1 position 5.
|-
| STOP || create a STOP condition on the bus.
|-
|}
f4dd11a08840bf1711c2fed71eb1a5b4b8b7b05e
Bw tool
0
1635
2667
2491
2013-09-02T10:58:45Z
Rew
3
/* basic example */
wikitext
text/x-wiki
= intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= installation/compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Each folder contains a make file, so using the command
''make''
should work fine.
= basic example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= about permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. So by default Linux chooses to only allow the root user access to the SPI or I2C bus. So you have the following choices:
* You can run your whole session as root. I use "sudo -s" others recommend "sudo su", while "sudo bash" will also work.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Nowadays the "/dev" filesystem is kept in RAM, not somewhere on disk. So you will need to do that again, at every boot. You could add those commmands to your rc.local (in /etc/) to issue them automatically at every boot. Or you can tell udev that you want those devices world writable. I haven't figured out yet how to do that exactly, so if you want to do the research, feel free to do it that way and report how it's done. (just create a WIKI account and add it here yourself or you can Email to info@ ... and let me do that.)
= options =
== options specifying the device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. This second i2c bus is the one that is broken out on the gpio's of rev2 raspberry pi's.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== options sending data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== reading data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== finer control ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that bitwizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
f51181664ce451d55867f31130112efda14ded27
Servo
0
50
2668
1568
2013-09-13T12:10:26Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
for the I2C connector see: [[I2C_connector_pinout]]
The pinout is standard for servo-motors;
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || Servo || PWM data.
|-
|}
Besides the seven servo outputs, there is an eighth header:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || - || No pin
|-
|}
This can be used to provide power to the servos. For example, mosts ESCs have a BEC on board. These would fit on this connector, leaving the PWM signal pin unconnected.
Recent versions of the board allow you to disconnect the servo-power from the SPI (or I2C) bus power. Allowing you to keep the "clean" 5V for the raspberry pi and the "dirty" 5V for the servos separate.
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || 5Vservo || 5V for the servos
|-
| 3 || 5V bus || 5V from the SPI or I2C bus.
|-
|}
The idea here is that you can connect your powersupply ground and 5V on 1-2, or a jumper on the 2-3 position to power the servos from the bus.
Keep in mind that even a small 9g servo will draw at least 500mA when you tell it to "suddenly" change position. So if your powersupply isn't powerful enough, 7 servos going to a new position may crash your BitWizard Servo board, or even your raspberry pi.
=== LEDs ===
One LED is the normal power-LED. It is powered from the serial-bus-5V.
The other led, next to the servo connectors, shows you the status of the 5V that powers the servos. If for example, you forget to connect the jumper (2-3) for bus-powered servos, the led will show you that.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
9d2da2f5c5e9f0f4509ed51b625579167a8b6cde
Rtc
0
1652
2671
2532
2013-10-07T08:17:17Z
Rew
3
wikitext
text/x-wiki
Load the I2C and RTC drivers as root:
sudo -s
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.d/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device // For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device // For rev2 RPi
hwclock -s
Source: http://www.element14.com/community/message/63885
2a0feae9528aa73cc2674aacef201fb9668df467
2672
2671
2013-10-07T08:17:45Z
Rew
3
wikitext
text/x-wiki
Load the I2C and RTC drivers as root:
sudo -s
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.d/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
hwclock -s
Source: http://www.element14.com/community/message/63885
2effceb09398c4d6c29e50475d93b2e9067abdaa
Temperature Interface
0
51
2673
2460
2013-10-14T08:13:58Z
Rew
3
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
1 VCC
2 signal
3 GND
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5695adfbe00a890ef7eadf83d383eefc245422c9
2674
2673
2013-10-14T08:16:20Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
662f20610946d3d80b5ab1ee3aca6a9d4ba10036
2675
2674
2013-10-14T08:16:33Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
2d12cb383fac734531eb15f2ff299d9010034faf
2676
2675
2013-10-14T08:22:47Z
Rew
3
/* The software */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
18ea3980c6b79610128e1d79ffbdbc01d351135f
2677
2676
2013-10-14T08:23:05Z
Rew
3
/* accuracy */
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the SPI_temp and I2C_temp boards.
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
8963cb9fd7a37fadc596d94ba56861e31131d1a6
Servo
0
50
2678
2668
2013-10-19T15:00:22Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards.
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
for the I2C connector see: [[I2C_connector_pinout]]
The pinout is standard for servo-motors;
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || Servo || PWM data.
|-
|}
Pin one is located closest to the side of the board.
Besides the seven servo outputs, there is an eighth header:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || - || No pin
|-
|}
This can be used to provide power to the servos. For example, mosts ESCs have a BEC on board. These would fit on this connector, leaving the PWM signal pin unconnected.
Recent versions of the board allow you to disconnect the servo-power from the SPI (or I2C) bus power. Allowing you to keep the "clean" 5V for the raspberry pi and the "dirty" 5V for the servos separate.
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || 5Vservo || 5V for the servos
|-
| 3 || 5V bus || 5V from the SPI or I2C bus.
|-
|}
The idea here is that you can connect your powersupply ground and 5V on 1-2, or a jumper on the 2-3 position to power the servos from the bus.
Keep in mind that even a small 9g servo will draw at least 500mA when you tell it to "suddenly" change position. So if your powersupply isn't powerful enough, 7 servos going to a new position may crash your BitWizard Servo board, or even your raspberry pi.
=== LEDs ===
One LED is the normal power-LED. It is powered from the serial-bus-5V.
The other led, next to the servo connectors, shows you the status of the 5V that powers the servos. If for example, you forget to connect the jumper (2-3) for bus-powered servos, the led will show you that.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
9b166e2e3dcc9ac288428ee9a61f315c7088353b
Lcd protocol 1.6
0
1613
2679
2609
2013-10-20T14:54:04Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.<br>Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast. Is written to EEPROM.
|-
| 0x13 || set backlight. Temporary.
|-
| 0x14 || reinit LCD.
|-
| 0x17 || set backlight, save to EEPROM.
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances.
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
c6e3bb2746b8ba858b27f6cd5b2a6126a1461bbc
2680
2679
2013-10-20T15:00:54Z
Rew
3
/* read ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.<br>Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast. Is written to EEPROM.
|-
| 0x13 || set backlight. Temporary.
|-
| 0x14 || reinit LCD.
|-
| 0x17 || set backlight, save to EEPROM.
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances.
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|}
= read ports =
The lcd boards support several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || current contrast value.
|-
| 0x13 || current backlight value.
|-
| 0x16 || number of bytes-in-buffer. The buffer is 32 bytes, This allows you to prevent sending a long string if it will overrun the buffer.
|-
| 0x17 || read the power-up-backlight-value (not the current).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
8147ece4ccae2fcbf63df01d84c7fc5e09ff3e33
2686
2680
2013-11-23T16:54:16Z
Rew
3
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.<br>Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast. Is written to EEPROM.
|-
| 0x13 || set backlight. Temporary.
|-
| 0x14 || reinit LCD.
|-
| 0x17 || set backlight, save to EEPROM.
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances.
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || write 0xaa here to unlock the change address register.
|}
= read ports =
The lcd boards support several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || current contrast value.
|-
| 0x13 || current backlight value.
|-
| 0x16 || number of bytes-in-buffer. The buffer is 32 bytes, This allows you to prevent sending a long string if it will overrun the buffer.
|-
| 0x17 || read the power-up-backlight-value (not the current).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
998c93e51cba30b935e3508b67ae661448f637e6
2687
2686
2013-11-28T08:17:39Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.<br>Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast. Is written to EEPROM.
|-
| 0x13 || set backlight. Temporary.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command.
|-
| 0x17 || set backlight, save to EEPROM.
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances.
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || write 0xaa here to unlock the change address register.
|}
= read ports =
The lcd boards support several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || current contrast value.
|-
| 0x13 || current backlight value.
|-
| 0x16 || number of bytes-in-buffer. The buffer is 32 bytes, This allows you to prevent sending a long string if it will overrun the buffer.
|-
| 0x17 || read the power-up-backlight-value (not the current).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
117ba88621c9d660c857f1aadc7d009230170173
2689
2687
2013-11-30T11:20:32Z
Rew
3
/* write ports */
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.<br>Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast. Is written to EEPROM. (*)
|-
| 0x13 || set backlight. Temporary.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command.
|-
| 0x17 || set backlight, save to EEPROM. (*)
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances. (*)
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances. (*)
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first. (*)
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || write 0xaa here to unlock the change address register.
|}
(*) These values are written to the eeprom. If you write "0xff", the value will be interpreted as "empty eeprom" on next boot, and the default will be used.
= read ports =
The lcd boards support several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || current contrast value.
|-
| 0x13 || current backlight value.
|-
| 0x16 || number of bytes-in-buffer. The buffer is 32 bytes, This allows you to prevent sending a long string if it will overrun the buffer.
|-
| 0x17 || read the power-up-backlight-value (not the current).
|}
= startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
a5724ae3fb54681c5c147db662668c3e0dc862ed
User Interface
0
1505
2682
2666
2013-10-25T23:09:18Z
Rew
3
/* jumper settings */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
1f535ce5fee7b2b6abb6fe7c8da54857effa01e3
2683
2682
2013-10-28T06:48:27Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ca2a9528c7d3282e0acc9ce5968a2e5300d60fe2
2688
2683
2013-11-28T08:19:14Z
Rew
3
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Overview ==
== Installation of the I2C Version ==
If you run your Pi on the standard raspian wheezy image ([http://www.raspberrypi.org/downloads download]) you will need to do modify some config files.
'''1.'''<br />
''/etc/modprobe.d/raspi-blacklist.conf'' <br />
Comment the line ''blacklist i2c-bcm2708'' <br />
<br />
The file should look like this afterwards: <br />
<nowiki>
blacklist spi-bcm2708 </nowiki><br /><nowiki>
#blacklist i2c-bcm2708 </nowiki><br /><nowiki>
</nowiki>
<br />
'''2.''' <br />
''/etc/modules'' <br />
Add ''i2c-dev'' at the end. <br />
<br />
'''3.''' <br />
Reboot the pi. You should be able to see the devices ''/dev/i2c-0'' and ''/dev/i2c-1'' <br />
== Assembly instructions ==
== Specifications ==
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a389f8d5b4366f0756db9c2ff737c5cd8decbb91
RPi SPI wheezy
0
1055
2690
1820
2013-12-11T16:45:33Z
Rew
3
wikitext
text/x-wiki
= Introduction =
This guide is a bit outdated. It mentions bw_spi as a tool, but that tool has been discontinued in favor of bw_tool. We hope to make further corrections/updates soon.
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Things we will be using =
* Raspberry Pi
* 2GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable
* SD-card reader
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
* [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://downloads.raspberrypi.org/images/raspbian/2012-08-16-wheezy-raspbian/2012-08-16-wheezy-raspbian.zip Raspbian "wheezy" image for Raspberry Pi, with hardware floating point support]
* [http://www.bitwizard.nl/software/bw_upgrade Script to enable SPI and I2C, and to update your Pi's software]
Unpack the Raspbian image, and download the script. I advise on making a seperate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favourite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=debian6-19-04-2012.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
Next, we need to move the modified kernel image and modules to the freshly flashed SD card. For this, you need to mount the partitions on your SD card. Im lazy, and just unplug my card reader, and plug it back in. Ubuntu then automagically mounts the two relevant partitions.<br>
You will see a small (56MB) partition (mounted as /media/1AF7-904A on my system), which is the /boot partition/directory. You will also see a larger (approx 1.7GB) partition, containing all other data (mounted as /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0 on my system). You may need to change the target directory in the following commands.
Copy the relevant script:
cp bw_upgrade /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/
Make sure the script is executable:
chmod 755 /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0/home/pi/bw_upgrade
And your SD card is ready!<br>
Unmount your CD card
sudo umount /media/8fe3c9ad-c8f5-4b39-aec2-f6e8dba743e0
sudo umount /media/1AF7-904A
And remove the SD card from your reader.
== Under Windows ==
Will be written ASAP.
= connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the raspberry pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the raspberry pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to raspberry pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
= Playing time =
SSH into your Pi. If you have a monitor attached, your Pi will tell you it's IP address: "My network IP address is 192.168.1.116" (or an other IP of course). If you don't have a monitor attached, you need to check your routers logs to find out which IP your Pi has.<br>
SSH into your pi:
ssh 192.168.1.116 -l pi
The default password is "raspberry"
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo ./bw_rpi_tools/bw_spi/bw_lcd -T 0,0 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the source of bw_lcd, or its [[Raspberry_Pi_LCD_program]] manual for other options.
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_lcd -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_lcd -a 82 -r 16 -v 0
Now your display should be cleared. <br>
Note: We have written a new program, bw_tool, which is also capable of controlling our SPI boards. However, we still need to write the documentation for it. The program and sources are located in ~/bw_rpi_tools/bw_tool .
= Congratulations! =
If you managed to get everything in this howto working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
cc4a9795930eaed9e97104383aad880ac1089a8b
Main Page
0
1
2691
2596
2013-12-20T15:53:44Z
Tom
4
/* Other boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
66d0c86f03188dde47b4c67ed1475ce851ccabb2
2717
2691
2014-01-21T13:38:29Z
Rew
3
/* Expansion boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
d6fd1f306a32ea7825d6c12b1b5f8a7c4065c0f5
Talk:Reducing power consumption of a raspberry Pi
1
1668
2694
2013-12-30T07:20:03Z
Argentus
2505
Created page with "Re: Eliminating the 12V-5V converter in your low-power Raspberry Pi implementation Dear BitWizard, I have found your page most helpful in my own hack. I have duplicated your..."
wikitext
text/x-wiki
Re: Eliminating the 12V-5V converter in your low-power Raspberry Pi implementation
Dear BitWizard,
I have found your page most helpful in my own hack. I have duplicated your work and it works; Thank you!
I realized that VDD_BAT merely needs to be tied to 3.3V for it to work. There is no need to include a second 12V to 5V converter specifically for VDD_BAT. I have verified this with my setup and it led to further power saving (1.524W down to 1.44W at idle). Please consider trying it on your own Raspberry Pi too!
Regards,
Ben
fee2db4dcf80a4630f6ec6f653974702d6433cce
2695
2694
2013-12-30T08:23:09Z
Rew
3
wikitext
text/x-wiki
Re: Eliminating the 12V-5V converter in your low-power Raspberry Pi implementation
Dear BitWizard,
I have found your page most helpful in my own hack. I have duplicated your work and it works; Thank you!
I realized that VDD_BAT merely needs to be tied to 3.3V for it to work. There is no need to include a second 12V to 5V converter specifically for VDD_BAT. I have verified this with my setup and it led to further power saving (1.524W down to 1.44W at idle). Please consider trying it on your own Raspberry Pi too!
Regards,
Ben
VDD_BAT is now tied to the +5V, right?
You need to know where the 5V goes to analyse what will stop working when you "lose" the 5V....
* The CPU will work with a voltage from (I expect) 3.0V up to 5.5V. No problem. (most designs with this chip will tie it to the lipo battery voltage 3.2 to 4.2V, but raspberry pi ties it to 5V, and quotes an absolute maximum of 5.5V)
* The 5V is used to create 3.3V through an LM1117-3.3 . This is no problem if you supply the 3.3V by other means. (The LM1117 will probably die if its input becomes significantly lower than its output, but we're planning on tying them together, so no problem).
* 5V for the USB ports. If you don't have USB devices, or connect them through a powered hub this can be OK.
* 5V for the HDMI port. I have a bunch VGA screens leftover, and little HDMI screens, so I have a few of those HDMI to VGA converters lying around. These use the 5V on the HDMI port and won't work off 3.3V. If you're not using a screen or using one with HDMI, no problem.
So... with two caveats, yes that's possible!
8527777d479342efd529bf2d71e82bfd581da7ba
Reducing power consumption of a raspberry Pi
0
802
2697
1701
2014-01-01T14:42:50Z
Rew
3
/* Conclusion */
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [[http://www.bitwizard.nl/catalog/product_info.php?cPath=26&products_id=99|switching regulator from our shop]]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work is devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
2c41ff9971a8cec108b86b63dbb9a5a14a656323
2698
2697
2014-01-01T14:45:17Z
Rew
3
/* Further reduction */
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [[http://www.bitwizard.nl/catalog/product_info.php?cPath=26&products_id=99|switching regulator from our shop]]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work are devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
9acd4dfda9f35dce9d307b6756a2c33911ec6e02
Raspberry Pi camera extension kit
0
1665
2700
2634
2014-01-09T15:58:28Z
Rew
3
/* Shipped after 20-07-2013 */
wikitext
text/x-wiki
= Connecting everything =
== Shipped after 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on teh raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
== Shipped BEFORE 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on the same side of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the same-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi"<br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
1572e7b7105e3ce1bf7755844f01dbcbe0893db5
2701
2700
2014-01-09T16:32:17Z
Rew
3
/* Shipped after 20-07-2013 */
wikitext
text/x-wiki
= Connecting everything =
== Shipped after 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
== Shipped BEFORE 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on the same side of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the same-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi"<br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
6afd8517192306295178effc6a1d75fbd3ca48f1
Bcm2835 i2c bug
0
1671
2702
2014-01-11T13:06:36Z
Rew
3
Created page with "= The bug = The I2C module in the BCM2835 SOC has a bug. In most protocols the master device will dictate the speed of communiciation. I2C is a bit smarter in that a slave c..."
wikitext
text/x-wiki
= The bug =
The I2C module in the BCM2835 SOC has a bug.
In most protocols the master device will dictate the speed of communiciation. I2C is a bit smarter in that a slave can ask the master to slow down. This mechanism is called clock stretching.
Signals on the I2C bus are never driven "high" by any bus-device. There is a passive pullup that creates the "high" level, and bus-devices can pull the signals low. Clock stretching works by the slave pulling the clock signal low during the time that it is not yet ready to recieve the next clock pulse. A master should check that the clock signal has become high before proceding with the next clock pulse.
The problem with the BCM2835 is that it checks if the clock signal has become "high" just nanonseconds before it would normally pull the clock signal low. If it determines that the clock signal is low, it will proceed by trying again a bit later. Clock stretching as it is supposed to work. When the slave does not do clock stretching the BCM2835 will see a high, and proceed to pull the clock signal low. Also good.
However, bad things can happen when the slave does clock stretching but is ready just nanoseconds before the BCM2835 checks the signal. The clock signal will go high, the BCM2835 sees a high signal and proceeds with pulling the signal low again shortly thereafter. The "high" period of the clock pulse can then be as short as 80 ns.
For the bitwizard I2C boards this is a problem: Short pulses on the SCL line are filtered out as "glitches". So whereas the BCM2835 then thinks it is providing the next "low" SCL period, our board still sees the previous clock-low-period. Master and slave are desynchronized and this leads to problems (i.e. our board seeing a different datavalue, our board not sending an ACK because it expects another bit, and the actual ACK extending into the "bus idle" period that follows a transaction (this foils the "start" condition of the next transactions)).
This is hardware-bug in the BCM2835.
= What can be done about this? =
Not much: It is a hardware bug. You can't upgrade the existing hardware without making new chips.
The BitWizard I2C boards now time the release of the SCL signal about 5 (or 15) microseconds after the clock edge. This puts the release about 5 microseconds away from the sampling and reassertion of the SCL signal by the BCM2835.
The consequence of this is however that we have to assume a 100kHz clock. If the clock is not 100kHz, the BCM2835 bug might be triggered.
So... Due to a bug in the BCM2835 SOC hardware, it is strongly recommended to use the default 100kHz clock and nothing else.
55c324caf67e76bfad2954178e7b1b3c7053523c
2703
2702
2014-01-11T13:11:54Z
Rew
3
/* What can be done about this? */
wikitext
text/x-wiki
= The bug =
The I2C module in the BCM2835 SOC has a bug.
In most protocols the master device will dictate the speed of communiciation. I2C is a bit smarter in that a slave can ask the master to slow down. This mechanism is called clock stretching.
Signals on the I2C bus are never driven "high" by any bus-device. There is a passive pullup that creates the "high" level, and bus-devices can pull the signals low. Clock stretching works by the slave pulling the clock signal low during the time that it is not yet ready to recieve the next clock pulse. A master should check that the clock signal has become high before proceding with the next clock pulse.
The problem with the BCM2835 is that it checks if the clock signal has become "high" just nanonseconds before it would normally pull the clock signal low. If it determines that the clock signal is low, it will proceed by trying again a bit later. Clock stretching as it is supposed to work. When the slave does not do clock stretching the BCM2835 will see a high, and proceed to pull the clock signal low. Also good.
However, bad things can happen when the slave does clock stretching but is ready just nanoseconds before the BCM2835 checks the signal. The clock signal will go high, the BCM2835 sees a high signal and proceeds with pulling the signal low again shortly thereafter. The "high" period of the clock pulse can then be as short as 80 ns.
For the bitwizard I2C boards this is a problem: Short pulses on the SCL line are filtered out as "glitches". So whereas the BCM2835 then thinks it is providing the next "low" SCL period, our board still sees the previous clock-low-period. Master and slave are desynchronized and this leads to problems (i.e. our board seeing a different datavalue, our board not sending an ACK because it expects another bit, and the actual ACK extending into the "bus idle" period that follows a transaction (this foils the "start" condition of the next transactions)).
This is hardware-bug in the BCM2835.
= What can be done about this? =
Not much: It is a hardware bug. You can't upgrade the existing hardware without making new chips.
The BitWizard I2C boards now time the release of the SCL signal about 5 (or 15) microseconds after the clock edge. This puts the release about 5 microseconds away from the sampling and reassertion of the SCL signal by the BCM2835. Although the 5 microsecond clock pulse is officially way out of spec for the I2C bus, it is reliably detected by our hardware.
The consequence of this is however that we have to assume a 100kHz clock. If the clock is not 100kHz, the BCM2835 bug might be triggered.
So... Due to a bug in the BCM2835 SOC hardware, it is strongly recommended to use the default 100kHz clock and nothing else.
80297776c731fb7682c888444da3b9c5d65f7437
2704
2703
2014-01-11T15:27:11Z
Rew
3
/* What can be done about this? */
wikitext
text/x-wiki
= The bug =
The I2C module in the BCM2835 SOC has a bug.
In most protocols the master device will dictate the speed of communiciation. I2C is a bit smarter in that a slave can ask the master to slow down. This mechanism is called clock stretching.
Signals on the I2C bus are never driven "high" by any bus-device. There is a passive pullup that creates the "high" level, and bus-devices can pull the signals low. Clock stretching works by the slave pulling the clock signal low during the time that it is not yet ready to recieve the next clock pulse. A master should check that the clock signal has become high before proceding with the next clock pulse.
The problem with the BCM2835 is that it checks if the clock signal has become "high" just nanonseconds before it would normally pull the clock signal low. If it determines that the clock signal is low, it will proceed by trying again a bit later. Clock stretching as it is supposed to work. When the slave does not do clock stretching the BCM2835 will see a high, and proceed to pull the clock signal low. Also good.
However, bad things can happen when the slave does clock stretching but is ready just nanoseconds before the BCM2835 checks the signal. The clock signal will go high, the BCM2835 sees a high signal and proceeds with pulling the signal low again shortly thereafter. The "high" period of the clock pulse can then be as short as 80 ns.
For the bitwizard I2C boards this is a problem: Short pulses on the SCL line are filtered out as "glitches". So whereas the BCM2835 then thinks it is providing the next "low" SCL period, our board still sees the previous clock-low-period. Master and slave are desynchronized and this leads to problems (i.e. our board seeing a different datavalue, our board not sending an ACK because it expects another bit, and the actual ACK extending into the "bus idle" period that follows a transaction (this foils the "start" condition of the next transactions)).
This is hardware-bug in the BCM2835.
= What can be done about this? =
Not much: It is a hardware bug. You can't upgrade the existing hardware without making new chips.
The BitWizard I2C boards now time the release of the SCL signal about 5 (or 15) microseconds after the clock edge. This puts the release about 5 microseconds away from the sampling and reassertion of the SCL signal by the BCM2835. Although the 5 microsecond clock pulse is officially way out of spec for a 100kHz I2C bus, it is reliably detected by our hardware.
The consequence of this is however that we have to assume a 100kHz clock. If the clock is not 100kHz, the BCM2835 bug might be triggered.
So... Due to a bug in the BCM2835 SOC hardware, it is strongly recommended to use the default 100kHz clock and nothing else.
aed261be411521e3f160bae12b01a7a409aa849d
3FETs
0
483
2705
2359
2014-01-14T11:32:34Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
7a7d48b119e15b690913afac0ded716dc1b864f4
2706
2705
2014-01-14T12:54:49Z
Rew
3
/* LEDs */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
88a8de323b13abb0234d78d8c83ac0d2b73b1a6b
2708
2706
2014-01-14T12:56:09Z
Rew
3
/* block diagram */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
76a6fcce2cf8a2597351e093ee5494c6645f11e8
File:3fets.png
6
1672
2707
2014-01-14T12:55:39Z
Rew
3
3fets board block diagram.
wikitext
text/x-wiki
3fets board block diagram.
37ad37ddae924a7ccb568f4116cb054d6a5fb84c
Assembling the rpi+rpi ui case.
0
1662
2709
2591
2014-01-17T15:36:11Z
Rew
3
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
= V2.1 and newer =
We find the following procedure the easiest....
The terms front/back/top/bottom/left/right refer to the position of the assembly with the screen on top and the switches facing you. So the front is the side with the audio and video connector, back is where the HDMI connector lives.
Screw two M3x10mm screws into the two standoffs. Next place these into the key-hole-shaped holes in the rpi_ui. After inserting the screw you can tighten the standoff onto the PCB by turning it. Don't tighten them too strongly. (so far I've always been able to unscrew them without trouble, but you want to be able to slide them sideways because you can't reach the screw on top.)
Next mount the rpi_ui onto the raspberry pi.
Next you can use the 4mm standoffs and the M3x12 screws (*) to bolt the bottom plate to the raspberry pi and rpi_ui. Sometimes you'll have to nudge the big standoffs a bit to get the to align enough with the holes in the 'pi. Next put the two small keys (the ones without the circular cutout for the TV connector) into the bottom. Next place the top plate on the rpi_ui and fit it into the keys. Now you can mount the back plate and fixate it with the two M3x6 screws. Don't tighten them all the way. At this point some play is necessary. Now insert the front key, the one with the cutout for the TV connector between the top and bottom plates in the front.
Next the sides can be mounted, followed by the front. Fixate the front and then tighten all three screws. But be careful the acrylic is easily damaged by tightening the screws too far.
(*) or M3x15.
= V2.0 and older =
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case which has the HDMI connector cutout. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. I recommend that you don't tighten the screws all the way. This allows for some play during the rest of the assembly. But even then, the case is already starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
Now you can finish tightening all the screws.
13f9310a552150556151756397763d791f5aea65
2710
2709
2014-01-17T15:36:39Z
Rew
3
/* V2.1 and newer */
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
= V2.1 and newer =
We find the following procedure the easiest....
The terms front/back/top/bottom/left/right refer to the position of the assembly with the screen on top and the switches facing you. So the front is the side with the audio and video connector, back is where the HDMI connector lives. (as depicted in the picture on the right).
Screw two M3x10mm screws into the two standoffs. Next place these into the key-hole-shaped holes in the rpi_ui. After inserting the screw you can tighten the standoff onto the PCB by turning it. Don't tighten them too strongly. (so far I've always been able to unscrew them without trouble, but you want to be able to slide them sideways because you can't reach the screw on top.)
Next mount the rpi_ui onto the raspberry pi.
Next you can use the 4mm standoffs and the M3x12 screws (*) to bolt the bottom plate to the raspberry pi and rpi_ui. Sometimes you'll have to nudge the big standoffs a bit to get the to align enough with the holes in the 'pi. Next put the two small keys (the ones without the circular cutout for the TV connector) into the bottom. Next place the top plate on the rpi_ui and fit it into the keys. Now you can mount the back plate and fixate it with the two M3x6 screws. Don't tighten them all the way. At this point some play is necessary. Now insert the front key, the one with the cutout for the TV connector between the top and bottom plates in the front.
Next the sides can be mounted, followed by the front. Fixate the front and then tighten all three screws. But be careful the acrylic is easily damaged by tightening the screws too far.
(*) or M3x15.
= V2.0 and older =
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case which has the HDMI connector cutout. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. I recommend that you don't tighten the screws all the way. This allows for some play during the rest of the assembly. But even then, the case is already starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
Now you can finish tightening all the screws.
c872c09676fc37b03656412a513f3a6ec67d7205
2711
2710
2014-01-19T15:00:02Z
Rew
3
/* V2.1 and newer */
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
= V2.1 and newer =
We find the following procedure the easiest....
The terms front/back/top/bottom/left/right refer to the position of the assembly with the screen on top and the switches facing you. So the front is the side with the audio and video connector, back is where the HDMI connector lives. (as depicted in the picture on the right).
Screw two M3x10mm screws into the two standoffs. Next place these into the key-hole-shaped holes in the rpi_ui. After inserting the screw you can tighten the standoff onto the PCB by turning it. Don't tighten them too strongly. (so far I've always been able to unscrew them without trouble, but you want to be able to slide them sideways because you can't reach the screw on top.)
Next mount the rpi_ui onto the raspberry pi.
Next you can use the 4mm standoffs and the M3x12 screws (*) to bolt the bottom plate to the raspberry pi and rpi_ui. Sometimes you'll have to nudge the big standoffs a bit to get the to align enough with the holes in the 'pi. Next put the two small keys (the ones without the circular cutout for the TV connector) into the bottom. Next place the top plate on the rpi_ui and fit it into the keys. The top of the case is ALMOST symmetrical. If the buttons don't fit as nicely as they should, try it the other way around (inside-out).
Now you can mount the back plate and fixate it with the two M3x6 screws. Don't tighten them all the way. At this point some play is necessary. Now insert the front key, the one with the cutout for the TV connector between the top and bottom plates in the front.
Next the sides can be mounted, followed by the front. Fixate the front and then tighten all three screws. But be careful the acrylic is easily damaged by tightening the screws too far.
(*) or M3x15.
= V2.0 and older =
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case which has the HDMI connector cutout. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. I recommend that you don't tighten the screws all the way. This allows for some play during the rest of the assembly. But even then, the case is already starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
Now you can finish tightening all the screws.
78374a84d79d56daf0509ddf37d9418befd6fb45
USB Relay
0
1678
2718
2014-01-21T16:52:48Z
Rew
3
Created page with "== intro == The USB relay board has two relays that can easily be controlled from a computer. This allows your computer to switch the mains for other devices or signals or l..."
wikitext
text/x-wiki
== intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyUSBx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
887395951384219577921e09552d63d0f0de6d8f
Servo 1.0 protocol
0
126
2721
2462
2014-02-05T13:53:16Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0x28-0x2e || set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
f6ddb055aa9999c8ecac8ec0964bf30300131088
2722
2721
2014-02-05T14:19:18Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20 || Set servo 0 position
|-
| 0x21 || Set servo 1 position
|-
| 0x22 || Set servo 2 position
|-
| 0x23 || Set servo 3 position
|-
| 0x24 || Set servo 4 position
|-
| 0x25 || Set servo 5 position
|-
| 0x26 || Set servo 6 position
|-
| 0x28-0x2e || set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
22a7e7f4938961362e75f32d544ee1494c00d538
2723
2722
2014-02-05T14:21:59Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20 || read servo 0 position
|-
| 0x21 || read servo 1 position
|-
| 0x22 || read servo 2 position
|-
| 0x23 || read servo 3 position
|-
| 0x24 || read servo 4 position
|-
| 0x25 || read servo 5 position
|-
| 0x26 || read servo 6 position
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
de14242bd840b42258b6525c07dfb7a47cdf8882
2724
2723
2014-02-05T14:22:33Z
Rew
3
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || change address.
|}
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
7e088d07288d9d94fc9c596b5e886d6d3a3e2a77
2725
2724
2014-02-05T14:32:45Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || change address.
|}
(*) From version 1.1 and up.
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
b227940ab29351eaa62445bceecb4c1a7e6772fc
Raspberry pi expansion system page
0
86
2726
1234
2014-02-05T14:50:23Z
Rew
3
/* rpi_serial */
wikitext
text/x-wiki
= intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
For some things like standard RS232 serial ports or webcams, you can get cheap USB devices. But to drive a small 16x2 character LCD, or to switch mains-power rpi_serial is for you.
= rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= rpi_ui: the raspbery pi user interface =
This board is available in a version with 20x4 and a version with 16x2 display. As the rpi_serial it breaks out all the serial busses of the raspberry pi. It also has a display and 6 buttons integrated on the board. These are accessible through SPI0 or the I2C bus.
= expansion boards =
The following expansion boards have been designed:
* [[SPI_LCD]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[Servo|SPI_Servo]]
* [[LM35|SPI_LM35]]
* [[DIO|SPI_DIO]]
* [[Relay|SPI_relay]]
* [[I2C_LCD]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[Servo|I2C_Servo]]
* [[LM35|I2C_LM35]]
* [[DIO|I2C_DIO]]
* [[Relay|I2C_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
These expansion boards have two SPI connectors. The first SPI connector is for data transfer during normal operation. The other can be used to daisy-chain the SPI bus to other SPI expansion boards. Or it can be configured to be used as the programming port for the onboard AVR chip.
It should be possible to use one of the raspberry pi SPI buses for data-transfer, while you use the other one to program the AVR chip on the expansion board.
4d578df6864868f1bc7427f9ff13acbaaa1db382
USB-multio
0
46
2728
823
2014-03-04T14:31:52Z
Rew
3
/* Additional software */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
For software development, implmenting USB communication we recommend LUFA:
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
422e0cc43b37acc046f882a5e4d56daf79a56c78
I2C DAC
0
1679
2729
2014-03-10T16:54:54Z
Tom
4
Created page with "Set a voltage: sudo i2cset -y 0 0x60 0x40 0xff 0xf0 i ^^ ^ < Voltage bits"
wikitext
text/x-wiki
Set a voltage:
sudo i2cset -y 0 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
7c5b6e4db1987275f6f109654944e07fc0e901f3
2730
2729
2014-03-10T16:56:26Z
Tom
4
moved [[I2c dac]] to [[I2C DAC]]
wikitext
text/x-wiki
Set a voltage:
sudo i2cset -y 0 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
7c5b6e4db1987275f6f109654944e07fc0e901f3
2731
2730
2014-03-11T11:48:46Z
Rew
3
wikitext
text/x-wiki
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
136b8a2a6b79f90ab46e5c1d116d3fb1cdbe467b
2732
2731
2014-03-11T11:50:45Z
Rew
3
wikitext
text/x-wiki
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
ec07150bb98189e80275015ebc09d61cc429c029
IO Expander
0
1682
2735
2014-03-21T15:28:45Z
Tom
4
Created page with "Based on the MCP230008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip."
wikitext
text/x-wiki
Based on the MCP230008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.
ec23de2f13ab9843b0b267bcb386e98e6ded6455
I2C splitter
0
1683
2736
2014-03-21T15:29:23Z
Tom
4
Created page with "Based on the PCA9548A chip from NXP"
wikitext
text/x-wiki
Based on the PCA9548A chip from NXP
64f6265be4fc97ac9ba791c057ecec57d6f271fc
I2C ADC
0
1684
2737
2014-03-21T15:30:15Z
Tom
4
Created page with "Based on the MCP3424 chip from Microchip."
wikitext
text/x-wiki
Based on the MCP3424 chip from Microchip.
1c328692fb79eb9697055d86656b4e653e76b153
I2C DAC
0
1679
2738
2732
2014-03-21T15:30:44Z
Tom
4
wikitext
text/x-wiki
Based on the MCP4728 chip from Microchip.
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
01a581d00c6604540684275db7e4dc725151c117
2745
2738
2014-03-21T15:46:37Z
Tom
4
wikitext
text/x-wiki
Based on the MCP4728 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22187a.pdf
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
27fe89267b3e3c1198b861eaf05b3f6441000fc3
2747
2745
2014-03-21T15:53:27Z
Tom
4
wikitext
text/x-wiki
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
<br>
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
95f373277cbba1e9c66643c7fb471e2b9a862ea3
2752
2747
2014-03-21T16:06:25Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19mm (3mm from board edge)
= using the board =
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
2294565a223b19bee71c1d0b6abf6eb84dbba9aa
2754
2752
2014-03-21T16:07:00Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= using the board =
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
7699c9003caf19891b9274937cfd1c6e4839d115
2758
2754
2014-03-21T16:09:41Z
Tom
4
/* general info */
wikitext
text/x-wiki
= general info =
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
You can order both versions. The addresses of your board can be found on the bottom side.
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= using the board =
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
fecd0bb7a40b22ef9aac843ca33b0cdc4e4583de
2766
2758
2014-03-21T17:08:54Z
Tom
4
/* using the board */
wikitext
text/x-wiki
= general info =
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
You can order both versions. The addresses of your board can be found on the bottom side.
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= using the board =
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 (or 0x62 and 0x63) for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
16eaacb222f174d1413731293270c90cb563107e
SPI DAC
0
1685
2739
2014-03-21T15:31:27Z
Tom
4
Created page with "Based on the MCP4822 chip from Microchip."
wikitext
text/x-wiki
Based on the MCP4822 chip from Microchip.
1f5264b4ddd7fb43bae8c14894cbf28c60a4736d
2742
2739
2014-03-21T15:45:29Z
Tom
4
wikitext
text/x-wiki
Based on the MCP4822 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21953e.pdf
108d51974f04c77ae9c674bac61b0e8dbab4998c
2743
2742
2014-03-21T15:45:47Z
Tom
4
wikitext
text/x-wiki
Based on the MCP4822 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21953a.pdf
31d93a7224ad3213de91b3621f747a0d134878c1
2751
2743
2014-03-21T16:05:49Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP4822 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21953a.pdf
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19mm (3mm from board edge)
= using the board =
239417fbe6985f29e0efb57728783e1dbbdd832c
2755
2751
2014-03-21T16:07:08Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP4822 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21953a.pdf
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= using the board =
729d1c7599aa819fedc69be9f95cbe33780d199b
IO Expander
0
1682
2740
2735
2014-03-21T15:44:56Z
Tom
4
wikitext
text/x-wiki
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf
50f3a61464642af2b6608c79aa2def565acf2432
2741
2740
2014-03-21T15:45:10Z
Tom
4
wikitext
text/x-wiki
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf
89ad9961fc811e9900e2b95d3a83c2412fd3a4a3
2750
2741
2014-03-21T16:01:21Z
Tom
4
wikitext
text/x-wiki
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf <br>
<br>
I2C address:<br>
0100 000 tru 0100 111<br>
<br>
SPI address:<br>
0100 000 tru 0100 011<br>
<br>
8375e6a34ddbe46f8120b622e60d105addde8dc5
2757
2750
2014-03-21T16:07:51Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf <br>
<br>
I2C address:<br>
0100 000 tru 0100 111<br>
<br>
SPI address:<br>
0100 000 tru 0100 011<br>
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= using the board =
c5d37aeec64aea4af80c6ceba677488bbcdffe24
2762
2757
2014-03-21T16:11:27Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf <br>
<br>
I2C address:<br>
0100 000 tru 0100 111 (jumper selectable)<br>
<br>
SPI address:<br>
0100 000 tru 0100 011 (jumper selectable)<br>
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= using the board =
3ccf5f9a2b844981021b26ee4287f9b243589d08
I2C ADC
0
1684
2744
2737
2014-03-21T15:46:15Z
Tom
4
wikitext
text/x-wiki
Based on the MCP3424 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22088b.pdf
768912683498ffe33266a27e48204d9d1cc27de0
2748
2744
2014-03-21T15:55:49Z
Tom
4
wikitext
text/x-wiki
Based on the MCP3424 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22088b.pdf<br>
<br>
I2C address:<br>
1101 000 tru 1101 011<br>
<br>
92a2ae0fff3af6800a0577ac688dd329ad82e079
2753
2748
2014-03-21T16:06:53Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP3424 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22088b.pdf<br>
<br>
I2C address:<br>
1101 000 tru 1101 011<br>
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44mmx19mm (3mm from board edge)
= using the board =
091ec123baa106595ab64145fa932f43c60b68f7
2760
2753
2014-03-21T16:11:16Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the MCP3424 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22088b.pdf<br>
<br>
I2C address:<br>
1101 000 tru 1101 011 (jumper selectable)<br>
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44mmx19mm (3mm from board edge)
= using the board =
a583efe42f5af8ff68a8609ed46ef81d5cfbaefa
I2C splitter
0
1683
2746
2736
2014-03-21T15:47:05Z
Tom
4
wikitext
text/x-wiki
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf
a01de9bbd8768863269e75486283fbe4575d2f66
2749
2746
2014-03-21T15:56:52Z
Tom
4
wikitext
text/x-wiki
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111<br>
<br>
0c975bac2057eeb3e9a4c697f738961e87d22afc
2756
2749
2014-03-21T16:07:21Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111<br>
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= using the board =
593783c15ecd4ad053bf9932ea40112cd06e1897
2759
2756
2014-03-21T16:10:26Z
Tom
4
/* general info */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111<br>
<br>
Each I2C output has 4K7 pull-up resistors.
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= using the board =
8d20fbffaff16ff0c4783d55a90806b05a1c9399
2761
2759
2014-03-21T16:11:22Z
Tom
4
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= using the board =
b3a4c8f9f31a007a65f0c85ec47ce20f11b44a89
Main Page
0
1
2763
2717
2014-03-21T17:00:39Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[]]
* [[]]
* [[]]
* [[]]
== SPI chips ==
* [[]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
93602f81b075d6337a25a76a3b3d5cc5ec573333
2764
2763
2014-03-21T17:04:26Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A switch]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
74321d6e52aca034f68d239175fb64e48d8681d6
2765
2764
2014-03-21T17:04:44Z
Tom
4
/* I2C chips */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
6e2dae6784a5657a90c2ef77029d16582c565f75
Motor protocol
0
657
2768
2604
2014-04-11T15:44:07Z
Tom
4
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
d5584e6cca298faebebf778e611e4cb625afbfa5
2769
2768
2014-04-11T15:44:51Z
Tom
4
/* read ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
cd85fcbce3ff112654ad1c15261dc5235b3b6586
2770
2769
2014-04-11T15:46:15Z
Tom
4
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| ||
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
874a7f570d904793bae4ca708c5bb718cc249841
2771
2770
2014-04-11T16:03:23Z
Tom
4
/* read ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction A with intensity <byte>
|-
| 0x21 || Spin motor A in direction B with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction A with intensity <byte>
|-
| 0x31 || Spin motor B in direction B with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| 0x20 ||
|-
| 0x21 ||
|-
| 0x30 ||
|-
| 0x31 ||
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
4764b04f0dda32243a011060c926070ad9045c1d
2773
2771
2014-04-16T13:57:24Z
Tom
4
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction X with intensity <byte>
|-
| 0x21 || Spin motor A in direction Y with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction X with intensity <byte>
|-
| 0x31 || Spin motor B in direction Y with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| 0x20 || Read back intensity and direction of motor A
|-
| 0x21 || Read back intensity and direction of motor A
|-
| 0x30 || Read back intensity and direction of motor B
|-
| 0x31 || Read back intensity and direction of motor B
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
7110f25e9c3707c4817fcd16c35d7ac977775213
2778
2773
2014-04-29T14:19:15Z
Rew
3
/* write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction X with intensity <byte>
|-
| 0x21 || Spin motor A in direction Y with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction X with intensity <byte>
|-
| 0x31 || Spin motor B in direction Y with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|-
| 0x58 || set PWM value for all four outputs as a single 32-bit value.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| 0x20 || Read back intensity and direction of motor A
|-
| 0x21 || Read back intensity and direction of motor A
|-
| 0x30 || Read back intensity and direction of motor B
|-
| 0x31 || Read back intensity and direction of motor B
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
60b97576a8f3b3f7a44139b48dbce351f7151628
2779
2778
2014-04-29T14:20:27Z
Rew
3
/* read ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the SPI_motor board will be explained on this page.
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction X with intensity <byte>
|-
| 0x21 || Spin motor A in direction Y with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction X with intensity <byte>
|-
| 0x31 || Spin motor B in direction Y with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|-
| 0x58 || set PWM value for all four outputs as a single 32-bit value.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| 0x20 || Read back intensity and direction of motor A
|-
| 0x21 || Read back intensity and direction of motor A
|-
| 0x30 || Read back intensity and direction of motor B
|-
| 0x31 || Read back intensity and direction of motor B
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|-
| 0x58 || get all 4 PWM values as a 32-bit value.
|}
= examples =
== read identification ==
read the identification string of the board. (spi_motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
e81c9c0c16f882b7a6c52edb8f9910898ebfa76b
USB Relay
0
1678
2772
2718
2014-04-16T13:51:10Z
Tom
4
/* Protocol */
wikitext
text/x-wiki
== intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyACMx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
2544e352336a255245a92112f16ce11365e2f286
Field-upgrade bitwizard boards
0
1651
2780
2661
2014-04-30T15:38:47Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U flash:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
64dc99697afcfcccaa2207136c97abc6cc8fd088
2781
2780
2014-05-01T08:01:05Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
60238e54c9c55d4580e5cc1b8b6b5c40acd11eeb
Rpi power
0
1691
2782
2014-05-01T08:11:42Z
Rew
3
Created page with " * I2C or SPI. * switch off "now" or Switch off after xx seconds. * switch on: timed * switch on: button * switch on: external contact * swtich on: IR receiver? (later?) *..."
wikitext
text/x-wiki
* I2C or SPI.
* switch off "now" or Switch off after xx seconds.
* switch on: timed
* switch on: button
* switch on: external contact
* swtich on: IR receiver? (later?)
* Power input: USB connector.
* Power output: on the SPI/I2C connector.
4142ac73be49d049c9a65d459d05d5ec46c92c4d
Bw tool
0
1635
2783
2667
2014-05-07T06:38:01Z
Rew
3
/* installation/compiling */
wikitext
text/x-wiki
= intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= installation/compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
= basic example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= about permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. So by default Linux chooses to only allow the root user access to the SPI or I2C bus. So you have the following choices:
* You can run your whole session as root. I use "sudo -s" others recommend "sudo su", while "sudo bash" will also work.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Nowadays the "/dev" filesystem is kept in RAM, not somewhere on disk. So you will need to do that again, at every boot. You could add those commmands to your rc.local (in /etc/) to issue them automatically at every boot. Or you can tell udev that you want those devices world writable. I haven't figured out yet how to do that exactly, so if you want to do the research, feel free to do it that way and report how it's done. (just create a WIKI account and add it here yourself or you can Email to info@ ... and let me do that.)
= options =
== options specifying the device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. This second i2c bus is the one that is broken out on the gpio's of rev2 raspberry pi's.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== options sending data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== reading data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== finer control ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that bitwizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
fa3b9822f73c72831ee7e7875134dd56fc8c561b
Temperature sensor example
0
1571
2784
2323
2014-05-07T07:00:26Z
Rew
3
/* initialization */
wikitext
text/x-wiki
== initialization ==
The following is a script that I use to initialize the temperature sensors for the rpi_ui board.
#!/bin/sh
ui="bw_tool -a 94"
#ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -w 70:c7 # internal tempsens with internal 1.1V as reference
$ui -w 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -w 82:6
$io -w 80:2
The above script is written for the SPI version of the board. The commented out like is for the i2c-version. So activate that line if you have the i2c version (remove the comment marker).
== readout ==
The following is a script that shows the temperature on stdout. I call this script "showtemp".
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -s 100000 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
== display ==
The following clears the screen and then shows the temperature.
bw_tool -a 94 -w 10:0
bw_tool -a 94 -t "temp: "`./showtemp`
b19dc98f1a8f78877836313f406adf39c94f3311
DIO
0
52
2786
2579
2014-05-30T15:52:28Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards.
== Overview ==
This board enables you to read and write up to 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as analog inputs!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! analog?
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0 || yes
|-
| 4 || IO1 || yes
|-
| 5 || IO2 || no
|-
| 6 || IO3 || yes
|-
| 7 || d.n.c.
|-
| 8 || IO4 ||yes
|-
| 9 || IO5 ||no
|-
| 10 || IO6 ||yes
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
92c8b20306b8231b0dfb3faceaa1490bb49dfdef
Power
0
1693
2787
2014-05-30T15:57:38Z
Rew
3
Created page with "[[File:SPI_DIO.jpg|thumb|300px|alt=The power board|XXX need photo The DIO board (depicted: the SPI version)]] This is the documentation page for the SPI_POWER and I2C_POWERbo..."
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The power board|XXX need photo The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_POWER and I2C_POWERboards.
== Overview ==
This board enables you to power your main CPU (e.g. a raspberry pi) from an USB powersupply. This board will then function as a powerswitch for your project. This is especially useful if you're running off a battery.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || SW
|}
By grounding "sw" you can toggle the powerstatus of the slave system.
=== LEDs ===
The only LED is a power indicator. To conserve power, the led is OFF when the slave is off.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[POWER_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0ab05d6f371465b3b8c5303f0e1da0f5a119c721
2793
2787
2014-06-02T16:16:50Z
Rew
3
/* External resources */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The power board|XXX need photo The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_POWER and I2C_POWERboards.
== Overview ==
This board enables you to power your main CPU (e.g. a raspberry pi) from an USB powersupply. This board will then function as a powerswitch for your project. This is especially useful if you're running off a battery.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
When you schedule a "wakeup" and then power down the slave, the module will enter a low-power mode. In this mode, it will consume about 2mA. The button is checked less often than when the module is fully away. A longer keypress may be required to activate the slave.
The current consumption will be about 10mA when the slave is active. The sleep mode cannot be activated because that would interfere with the communications protocols.
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || SW
|}
By grounding "sw" you can toggle the powerstatus of the slave system.
=== LEDs ===
The only LED is a power indicator. To conserve power, the led is OFF when the slave is off.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[POWER_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c55c5dd26f8d2d9140c7772d3b69019e6f846b7a
DIO protocol
0
432
2788
2669
2014-05-30T15:59:11Z
Rew
3
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= write ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
bd1c0a6d8a81250a3607ded309b2d9fa334d3f5b
Default addresses
0
484
2789
2500
2014-05-30T16:07:02Z
Rew
3
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| LCD || 0x82
|-
| DIO || 0x84
|-
| SERVO || 0x86
|-
| 7FETs || 0x88
|-
| 3FETs || 0x8A
|-
| TEMP (sometimes called SPI_LM35) || 0x8C
|-
| RELAY || 0x8E
|-
| motor || 0x90
|-
| pipower || 0x92
|-
| RPi_UI || 0x94
|-
| 7segment || 0x96
|-
| spi_spi || 0x98
|-
| pushbutton || 0x9A
|-
| bigrelay || 0x9C
|-
| || 0x9E
|-
| thermo || 0xa0
|-
| ... || 0xA2
|-
| power || 0xA4
|}
99dec6521eedd364a2bdf1a4b8e461cb9140c3d1
POWER protocol
0
1694
2790
2014-05-30T16:12:27Z
Rew
3
Created page with "= Introduction = The protocol for the POWER board will be explained on this page. This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for..."
wikitext
text/x-wiki
= Introduction =
The protocol for the POWER board will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= write ports =
The POWER boards define several ports:
{| border=1
!port !! function
|-
| 0x20 || set the turn-off-time. 32-bits, in ms. This is an offset into the future. So specify 4000 to turn off in 4 seconds.
|-
| 0x21 || set the turn-on-time. 32-bits, in ms. Specify e.g. 600000 to turn the system back on in 10 minutes. This starts counting as soon as you set it.
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x20 || read the turn-off-time left. 32-bits, in ms.
|-
| 0x21 || read the turn-on-time left. 32-bits, in ms.
|-
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_POWER)
{| border=1
! data sent !! data received || explanation
|-
| 0xa5 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_POSER)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on ten minutes from now ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0xa4 || xx || select destination with address 0xa4 for WRITE
|-
| 0x21 || xx || port address: set turn-on-time
|-
| 0xc0 || xx || lowest byte of 600000 ms = 0x927c0 ms is 0xc0.
||-
| 0x27 || xx ||
-
| 0x09 || xx ||
|-
| 0x00 || xx || MSB.
|}
== turn off four seconds from now ==
(on your raspberry pi you can do this from your /etc/init.d/halt script just before the "halt -d -f ..." command. )
{| border=1
! data sent !! data recieved || explanation
|-
| 0xa4 || xx || select destination with address 0xa4 for WRITE
|-
| 0x20 || xx || port address: set turn-on-time
|-
| 0xa0 || xx || lowest byte of 4000 ms = 0xfa0 ms is 0xa0.
||-
| 0x0f || xx ||
-
| 0x00 || xx ||
|-
| 0x00 || xx || MSB.
|}
a007fab0da7d19942092ce13e33cc0b03466f114
2791
2790
2014-05-30T16:12:51Z
Rew
3
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the POWER board will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= write ports =
The POWER boards define several ports:
{| border=1
!port !! function
|-
| 0x20 || set the turn-off-time. 32-bits, in ms. This is an offset into the future. So specify 4000 to turn off in 4 seconds.
|-
| 0x21 || set the turn-on-time. 32-bits, in ms. Specify e.g. 600000 to turn the system back on in 10 minutes. This starts counting as soon as you set it.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x20 || read the turn-off-time left. 32-bits, in ms.
|-
| 0x21 || read the turn-on-time left. 32-bits, in ms.
|-
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_POWER)
{| border=1
! data sent !! data received || explanation
|-
| 0xa5 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_POSER)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on ten minutes from now ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0xa4 || xx || select destination with address 0xa4 for WRITE
|-
| 0x21 || xx || port address: set turn-on-time
|-
| 0xc0 || xx || lowest byte of 600000 ms = 0x927c0 ms is 0xc0.
||-
| 0x27 || xx ||
-
| 0x09 || xx ||
|-
| 0x00 || xx || MSB.
|}
== turn off four seconds from now ==
(on your raspberry pi you can do this from your /etc/init.d/halt script just before the "halt -d -f ..." command. )
{| border=1
! data sent !! data recieved || explanation
|-
| 0xa4 || xx || select destination with address 0xa4 for WRITE
|-
| 0x20 || xx || port address: set turn-on-time
|-
| 0xa0 || xx || lowest byte of 4000 ms = 0xfa0 ms is 0xa0.
||-
| 0x0f || xx ||
-
| 0x00 || xx ||
|-
| 0x00 || xx || MSB.
|}
f1709c20f635365327a7efc8cd541ef139af6eab
2792
2791
2014-05-30T16:13:33Z
Rew
3
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the POWER board will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= write ports =
The POWER boards define several ports:
{| border=1
!port !! function
|-
| 0x20 || set the turn-off-time. 32-bits, in ms. This is an offset into the future. So specify 4000 to turn off in 4 seconds.
|-
| 0x21 || set the turn-on-time. 32-bits, in ms. Specify e.g. 600000 to turn the system back on in 10 minutes. This starts counting as soon as you set it.
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= read ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x20 || read the turn-off-time left. 32-bits, in ms.
|-
| 0x21 || read the turn-on-time left. 32-bits, in ms.
|-
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_POWER)
{| border=1
! data sent !! data received || explanation
|-
| 0xa5 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_POSER)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on ten minutes from now ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0xa4 || xx || select destination with address 0xa4 for WRITE
|-
| 0x21 || xx || port address: set turn-on-time
|-
| 0xc0 || xx || lowest byte of 600000 ms = 0x927c0 ms is 0xc0.
||-
| 0x27 || xx ||
-
| 0x09 || xx ||
|-
| 0x00 || xx || MSB.
|}
== turn off four seconds from now ==
(on your raspberry pi you can do this from your /etc/init.d/halt script just before the "halt -d -f ..." command. )
{| border=1
! data sent !! data recieved || explanation
|-
| 0xa4 || xx || select destination with address 0xa4 for WRITE
|-
| 0x20 || xx || port address: set turn-on-time
|-
| 0xa0 || xx || lowest byte of 4000 ms = 0xfa0 ms is 0xa0.
||-
| 0x0f || xx ||
-
| 0x00 || xx ||
|-
| 0x00 || xx || MSB.
|}
4cd92bde9e5a009183e53b9852961c2bfa2e6116
Main Page
0
1
2794
2765
2014-06-12T10:42:52Z
Tom
4
/* General pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[thermocouple]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
8c74ff1a4b0339799d06a937150003038f2499a8
2801
2794
2014-07-07T11:38:02Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your developement environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
c13a87a2597ffee25a2664b0809a5f05a1641584
2802
2801
2014-07-07T11:39:29Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[RPi_SPI_wheezy|Beginners guide to SPI on Raspberry Pi]] (Raspbian “wheezy”)
* [[Beginners guide to SPI on Raspberry Pi]] (Debian "Squeeze". Obsolete; not recommended for fresh/new installations)
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
66c4f0e67b114f743743e903cbc9b85905dba433
2804
2802
2014-07-07T15:41:42Z
Rijk
2525
/* How-to's */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
5c7abbd7e6d56e5615ca8ea7794e10608cdc104f
2810
2804
2014-07-09T10:29:27Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Help =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an Email
* or use the forum: http://forum.bitwizard.nl/
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
b53e7a3ed708d029d5e464d70000308a87c3f0a4
2811
2810
2014-07-09T10:31:29Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
* [[SPI_SPI]]
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
bb10cb35177460116bd6284ac1d354210ec2c94d
2820
2811
2014-07-09T15:44:04Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB relay board]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
c37d5d2e3e329fa5fec7fa7e2fe20caf7995c7c2
2822
2820
2014-07-09T15:46:11Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
* [[PiPower|PiPower]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
7c1755940e0eee27b000ccb7fdce9537fa0c7578
2827
2822
2014-07-10T15:23:20Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
== Other ==
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
06601fb02e2e27dcf93450a949229a830e492ae2
2830
2827
2014-07-11T09:24:23Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
== General pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
0fd1ac2688d0a094f92ce6648507fcc79e4c255e
2831
2830
2014-07-11T09:27:26Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
== How-to's ==
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
== Kits ==
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
== Developement boards ==
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
== Expansion boards ==
= General =
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
= Board specific pages =
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
= Other boards =
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
a418ed8eba4e55dff524d15afd8821d7a61f45f4
2832
2831
2014-07-11T09:28:50Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
= Board specific pages =
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
7948526339997e4abfa7275d7f6ddd9c15f6348e
2833
2832
2014-07-11T09:29:20Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
794d77b5cff65ef8a11644b266bb56084d3f0493
Raspberry Pi camera extension kit
0
1665
2795
2701
2014-06-17T13:56:16Z
Tom
4
/* Shipped after 20-07-2013 */
wikitext
text/x-wiki
= Connecting everything =
== Shipped after 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin1 marking may be obsctructed by the right-angle connector. The wizard is on the pin16 side of the board)<br>
<br>
And you're done!
== Shipped BEFORE 20-07-2013 ==
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on the same side of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the same-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi"<br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards<br>
<br>
And you're done!
de7afd2a31aa22d037be8439165519a8ab01a789
2796
2795
2014-06-17T14:08:54Z
Tom
4
wikitext
text/x-wiki
= Connecting everything =
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board"<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin1 marking may be obsctructed by the right-angle connector. The wizard is on the pin16 side of the board)<br>
<br>
6c498bb3276fea4d68af0210b5f3d1b88ccd7c55
2799
2796
2014-06-30T15:48:09Z
Rew
3
/* Connecting everything */
wikitext
text/x-wiki
= Connecting everything =
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard is on the pin16 side of the board)<br>
<br>
cb80a16d40bf6c76892e602369725ee7b4dee7c1
2812
2799
2014-07-09T13:14:03Z
Rijk
2525
wikitext
text/x-wiki
= Connecting =
You can recognise this version by the way the connectors one the "camera board" convertor are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard is on the pin16 side of the board)<br>
<br>
dc09ce16675e545346ef32d1fc662103be220f64
2813
2812
2014-07-09T13:25:54Z
Rijk
2525
wikitext
text/x-wiki
== Overview ==
This kit allows you to expand the length of the Raspberry Pi camera by converting the standard FFC cable to a generic 2.54mm pin set. You could use the attached connectors to create a ribbon cable, let us create the ribbon cable, or use your own cable.
== Connecting ==
You can recognise this version by the way the connectors one the "camera board" converter are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard is on the pin16 side of the board)<br>
<br>
4b320c04fd6647678e8549bccf40e3952a8be96f
2816
2813
2014-07-09T13:32:12Z
Rijk
2525
wikitext
text/x-wiki
[[File:Rpicamextstraight.jpg|thumb|300px|Camera extension kit with straight pins]]
[[File:Rpicamextangle.jpg|thumb|300px|Camera extension kit with angled pins]]
== Overview ==
This kit allows you to expand the length of the Raspberry Pi camera by converting the standard FFC cable to a generic 2.54mm pin set. You could use the attached connectors to create a ribbon cable, let us create the ribbon cable, or use your own cable.
== Connecting ==
You can recognise this version by the way the connectors one the "camera board" converter are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard is on the pin16 side of the board)<br>
<br>
f787d333a63d908fb7e9f2305b4e6a2bce7bf4bc
2817
2816
2014-07-09T13:36:55Z
Rijk
2525
wikitext
text/x-wiki
[[File:Rpicamextstraight.jpg|thumb|300px|Camera extension kit with straight pins]]
[[File:Rpicamextangle.jpg|thumb|300px|Camera extension kit with angled pins]]
== Overview ==
This kit allows you to expand the length of the Raspberry Pi camera by converting the standard FFC cable to a generic 2.54mm pin set. You could use the attached connectors to create a ribbon cable, let us create the ribbon cable, or use your own cable. Please note that the ribbon cable has an angled connector. The kit can be found in the shop [http://www.bitwizard.nl/catalog/product_info.php?products_id=146 here]
== Connecting ==
You can recognise this version by the way the connectors one the "camera board" converter are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard is on the pin16 side of the board)<br>
<br>
e4169776773037486a0efc614f1b95646b583a80
FTDI ATmega
0
6
2797
1036
2014-06-23T13:36:11Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator.<br>
SJ1 (between the FTDI and the place for the regulator).
When you bridge this, the board becomes more "arduino compatible". The AVR will reset when you connect to the serial port. On arduino this is used to get the AVR into the bootloader.
SJ2 (between the crystal and the AVR)
This allows the AVR to run off a clock generated from the FTDI. Not really useful if you already have the crystal installed. And the FTDI can't generate 20MHz.
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
fa385e76f47506f98ed59a8ab92d64329da314a0
2798
2797
2014-06-23T13:37:31Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/catalog/product_info.php?products_id=29 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator. (officially only up to 8MHz!)<br>
SJ1 (between the FTDI and the place for the regulator).
When you bridge this, the board becomes more "arduino compatible". The AVR will reset when you connect to the serial port. On arduino this is used to get the AVR into the bootloader.
SJ2 (between the crystal and the AVR)
This allows the AVR to run off a clock generated from the FTDI. Not really useful if you already have the crystal installed. And the FTDI can't generate 20MHz.
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
423eabf07181df8adce346f1f1ed753539955501
Dimmer
0
1695
2800
2014-07-07T11:37:45Z
Rijk
2525
Created page with "The dimmer can be found in the shop [http://www.bitwizard.nl/catalog/product_info.php?products_id=166 here]"
wikitext
text/x-wiki
The dimmer can be found in the shop
[http://www.bitwizard.nl/catalog/product_info.php?products_id=166 here]
08732bf295f0178569aa9f7aaeaca16af9a1daf4
2805
2800
2014-07-09T09:44:08Z
Rijk
2525
wikitext
text/x-wiki
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found in the shop
[http://www.bitwizard.nl/catalog/product_info.php?products_id=166 here]
== Control ==
The dimmer is at I2C address 0x10. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -w 10:XXX
Where XXX is the intensity
b59a655f9d3fd92862acd0bafe6d479bd0ec83f2
2807
2805
2014-07-09T09:51:18Z
Rijk
2525
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found in the shop
[http://www.bitwizard.nl/catalog/product_info.php?products_id=166 here]
== Control ==
The dimmer is at I2C address 0x10. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -w 10:XXX
Where XXX is the intensity
03307376bad3f6f92800f22a0abf232dcc5f7e82
2818
2807
2014-07-09T15:38:04Z
Rijk
2525
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found in the shop
[http://www.bitwizard.nl/catalog/product_info.php?products_id=166 here]
== Control ==
The dimmer is at I2C port 0x10. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -w 10:XXX
Where XXX is the intensity
455b136d286347e54d1f388af44630681d669abf
2824
2818
2014-07-09T15:49:29Z
Rijk
2525
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found in the shop
[http://www.bitwizard.nl/catalog/product_info.php?products_id=166 here]
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -w 10:XXX
Where XXX is the intensity
2421128526c92111223aafb47df578361e9cefa2
Beginners guide to SPI on Raspberry Pi
0
794
2803
1729
2014-07-07T15:22:39Z
Rijk
2525
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -r 16 -v 0
Now your display should be cleared. <br>
Note: We have written a new program, bw_tool, which is also capable of controlling our SPI boards. However, we still need to write the documentation for it. The program and sources are located in ~/bw_rpi_tools/bw_tool .
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
3e7511c5eb1ad158c1cc7d1237aa075fa11ffac4
2834
2803
2014-07-14T15:49:07Z
Rew
3
/* Installing the program */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_lcd program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -r 16 -v 0
Now your display should be cleared. <br>
Note: We have written a new program, bw_tool, which is also capable of controlling our SPI boards. However, we still need to write the documentation for it. The program and sources are located in ~/bw_rpi_tools/bw_tool .
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
4d5380e2ce2592b382dc4e377ba64d787338f4c7
2835
2834
2014-07-14T15:49:40Z
Rew
3
/* Next steps */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_tool program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -r 16 -v 0
Now your display should be cleared. <br>
Note: We have written a new program, bw_tool, which is also capable of controlling our SPI boards. However, we still need to write the documentation for it. The program and sources are located in ~/bw_rpi_tools/bw_tool .
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
3104aca927b610050a2837f7ed457c142b1e3ef9
File:Dimmer small.jpg
6
1696
2806
2014-07-09T09:50:22Z
Rijk
2525
Bitwizard I2C Dimmer
wikitext
text/x-wiki
Bitwizard I2C Dimmer
515dd4a60e5bcd550ab875f53ce909f12c58df99
Default addresses
0
484
2808
2789
2014-07-09T10:13:52Z
Rijk
2525
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| Dimmer || 0x10
|-
| LCD || 0x82
|-
| DIO || 0x84
|-
| SERVO || 0x86
|-
| 7FETs || 0x88
|-
| 3FETs || 0x8A
|-
| TEMP (sometimes called SPI_LM35) || 0x8C
|-
| RELAY || 0x8E
|-
| motor || 0x90
|-
| pipower || 0x92
|-
| RPi_UI || 0x94
|-
| 7segment || 0x96
|-
| spi_spi || 0x98
|-
| pushbutton || 0x9A
|-
| bigrelay || 0x9C
|-
| || 0x9E
|-
| thermo || 0xa0
|-
| ... || 0xA2
|-
| power || 0xA4
|}
21a34980bae2a80965ab3b6725eab61ba1311a7f
2809
2808
2014-07-09T10:17:03Z
Rijk
2525
Undo revision 2808 by [[Special:Contributions/Rijk|Rijk]] ([[User talk:Rijk|talk]])
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| LCD || 0x82
|-
| DIO || 0x84
|-
| SERVO || 0x86
|-
| 7FETs || 0x88
|-
| 3FETs || 0x8A
|-
| TEMP (sometimes called SPI_LM35) || 0x8C
|-
| RELAY || 0x8E
|-
| motor || 0x90
|-
| pipower || 0x92
|-
| RPi_UI || 0x94
|-
| 7segment || 0x96
|-
| spi_spi || 0x98
|-
| pushbutton || 0x9A
|-
| bigrelay || 0x9C
|-
| || 0x9E
|-
| thermo || 0xa0
|-
| ... || 0xA2
|-
| power || 0xA4
|}
99dec6521eedd364a2bdf1a4b8e461cb9140c3d1
2819
2809
2014-07-09T15:38:45Z
Rijk
2525
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| LCD || 0x82
|-
| DIO || 0x84
|-
| SERVO || 0x86
|-
| 7FETs || 0x88
|-
| 3FETs || 0x8A
|-
| TEMP (sometimes called SPI_LM35) || 0x8C
|-
| RELAY || 0x8E
|-
| motor || 0x90
|-
| pipower || 0x92
|-
| RPi_UI || 0x94
|-
| 7segment || 0x96
|-
| spi_spi || 0x98
|-
| pushbutton || 0x9A
|-
| bigrelay || 0x9C
|-
| dimmer || 0x9E
|-
| thermo || 0xa0
|-
| ... || 0xA2
|-
| power || 0xA4
|}
2367c10c3c8360052a22aed6736a439aef9acaf0
2823
2819
2014-07-09T15:47:31Z
Rijk
2525
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| [[LCD]] || 0x82
|-
| [[DIO]] || 0x84
|-
| [[Servo]] || 0x86
|-
| [[7FETs]] || 0x88
|-
| [[3FETs]] || 0x8A
|-
| [[temp|Temp]] (sometimes called SPI_LM35) || 0x8C
|-
| [[relay|Relay]] || 0x8E
|-
| [[motor]] || 0x90
|-
| [[User Interface]] || 0x94
|-
| [[7_Segment]]|| 0x96
|-
<!--
| [[SPI_SPI]] || 0x98
|-
-->
| [[pushbutton]] || 0x9A
|-
| [[bigrelay]] || 0x9C
|-
| [[Dimmer]] || 0x9E
|-
<!--
| thermo || 0xa0
|-
| ... || 0xA2
|-
-->
| [[Raspberry Juice]] || 0xA4
|}
bb4b6c58374c49da46ae4348faebb29466486f0a
File:Rpicamextangle.jpg
6
1697
2814
2014-07-09T13:27:38Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Rpicamextstraight.jpg
6
1698
2815
2014-07-09T13:28:14Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Raspberry Juice
0
1699
2821
2014-07-09T15:44:30Z
Rijk
2525
Created page with "= Overview = The Raspberry Juice serves as a power switch for the Raspberry Pi."
wikitext
text/x-wiki
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi.
603129e8561c08913d2a0c70c0ef1220359a31ab
2825
2821
2014-07-09T16:00:25Z
Rijk
2525
wikitext
text/x-wiki
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time.
= Use =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
{| border=1
! Port !! Returned value
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
|-
| 0x30 || Absolute scheduled time of power off
|-
| 0x31 || Absolute scheduled time of power on
|}
0fff1a9b29fe8216207590f3a6f169c7a53ef2f7
2826
2825
2014-07-09T16:05:20Z
Rijk
2525
wikitext
text/x-wiki
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time.
= Use =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x30 || Absolute scheduled time of power off
|-
| 0x31 || Absolute scheduled time of power on
-->
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
6ecfc3793cfced4efc049d4a65719bc8fb47f072
2829
2826
2014-07-10T15:39:36Z
Rijk
2525
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time.
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Use =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x30 || Absolute scheduled time of power off
|-
| 0x31 || Absolute scheduled time of power on
-->
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|}
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
87daf9331e2bd44fb27fb4fe9485227eab421704
File:RaspberryJuice.jpg
6
1700
2828
2014-07-10T15:28:46Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Bridgeclock
0
1701
2836
2014-07-14T18:27:26Z
Rew
3
Created page with "= bridgeclock = == features == * Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round". * Easy-to-use user interface for adjustments..."
wikitext
text/x-wiki
= bridgeclock =
== features ==
* Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round".
* Easy-to-use user interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are slightly longer).
* Visible difference between "time left to change" and "time remaining in round".
== normal use ==
The bridgeclock is simple to use. Just plug it in and when it is time start the clock, push the start/stop button.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that before starting the clock for the first round.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing start/stop.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "prog". Now + and - will select the preset-program. Press "start/stop" to start this program, or pres "prog" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the + and - keys. The changeover time is adjusted with 20 second intervals. The other two with 1 minute intervals.
Pressing "prog" will move to the next option. The changes are automatically saved for the next time.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
51805d5e881eb8da6ae42e1babed7fd70e3db8a4
2837
2836
2014-07-14T18:28:44Z
Rew
3
/* features */
wikitext
text/x-wiki
= bridgeclock =
== features ==
* Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round".
* Easy-to-use user interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are slightly longer).
* Visible difference between "time left to change" and "time remaining in round".
* on-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and when it is time start the clock, push the start/stop button.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that before starting the clock for the first round.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing start/stop.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "prog". Now + and - will select the preset-program. Press "start/stop" to start this program, or pres "prog" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the + and - keys. The changeover time is adjusted with 20 second intervals. The other two with 1 minute intervals.
Pressing "prog" will move to the next option. The changes are automatically saved for the next time.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
402b90ff077176a59432d07b09936feb2c69bed1
SPI versus I2C protocols
0
673
2838
1159
2014-07-16T10:04:55Z
Rijk
2525
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Physical Differences =
The first difference between I2C and SPI is that I2C is two-wire, while SPI is four-wire.
= Technical Differences =
The I2C protocol is inherently half-duplex. The SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With these dummy packets, both protocols are now half-duplex.
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
3f9185e0089f07d874e30f4422bd2f2208a2837a
File:ModelB+.jpg
6
1702
2839
2014-07-16T12:08:29Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Model B+ compatibility
0
1703
2840
2014-07-16T12:09:01Z
Rijk
2525
Created page with "[[File:File.png|300px|thumb|left|The new Model B+]] On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the h..."
wikitext
text/x-wiki
[[File:File.png|300px|thumb|left|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= Raspberry Pi UI 16x2 =
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= Raspduino =
The Raspduino fits on the new model. The mounting holes are again covered.
9cf259e93a9367403422e49534701bece9cc3e8d
2841
2840
2014-07-16T12:09:20Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+|300px|thumb|left|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= Raspberry Pi UI 16x2 =
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= Raspduino =
The Raspduino fits on the new model. The mounting holes are again covered.
7bb8c9ed37aeef9752735768d343c5cdcd383df1
2842
2841
2014-07-16T12:09:29Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+.jph|300px|thumb|left|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= Raspberry Pi UI 16x2 =
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= Raspduino =
The Raspduino fits on the new model. The mounting holes are again covered.
b8a4244dceeab4066a57816b5cb87ca8c4430784
2843
2842
2014-07-16T12:09:38Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+.jpg|300px|thumb|left|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= Raspberry Pi UI 16x2 =
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= Raspduino =
The Raspduino fits on the new model. The mounting holes are again covered.
33ce126d44c39af8940db1d59dd8b67130e564b3
Model B+ compatibility
0
1703
2844
2843
2014-07-16T12:09:58Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+.jpg|300px|thumb|right|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= Raspberry Pi UI 16x2 =
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= Raspduino =
The Raspduino fits on the new model. The mounting holes are again covered.
030f44583569a27da2e4d405f39a93b67cbf453e
2845
2844
2014-07-16T12:11:47Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+.jpg|300px|thumb|right|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= [[User_Interface|Raspberry Pi UI 16x2]] =
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= [[Raspduino]] =
The Raspduino fits on the new model. The mounting holes are again covered.
8aa1edc8c618167bb06d98f758490e817fd852b7
2846
2845
2014-07-16T12:38:53Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+.jpg|200px|thumb|right|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= [[User_Interface|Raspberry Pi UI 16x2]] =
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= [[Raspduino]] =
The Raspduino fits on the new model. The mounting holes are again covered.
76145361f8bdabf36dc79cc6ba2507644d697e69
2848
2846
2014-07-16T12:41:02Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+.jpg|200px|thumb|right|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= [[User_Interface|Raspberry Pi UI 16x2]] =
[[File:RPi_uionmodelb+.JPG|200px|thumb|right|The Raspberry Pi UI with RTC module on the new Model B+]]
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered.
= [[Raspduino]] =
The Raspduino fits on the new model. The mounting holes are again covered.
82edb93e45c9b5d23e13573248d2e8ec7657ac52
2849
2848
2014-07-16T13:39:54Z
Rijk
2525
wikitext
text/x-wiki
[[File:ModelB+.jpg|200px|thumb|right|The new Model B+]]
On 14 June 2014, the Raspberry Pi foundation introduced a new model to the Raspbbery Pi family: The Model B+. While the hardware is mostly the same, the size and layout of the board has changed. This page will list all current BitWizard Raspberry Pi expansion boards and how they work with the new model.
= Main changes =
The Model B+ has the following differences from the original Model B:
* New, slightly smaller, form factor
* 4 mounting holes
* The analog video out and analog audio out are now combined in one connector
* The HDMI, USB power and analog out are now on the same side of the board
* 4 USB ports instead of 2, archived by using a new chip for USB
* 40 GPIO pins instead of 26, the Foundation claims it is still backwards compatible
* Rounded edges
= [[User_Interface|Raspberry Pi UI 16x2]] =
[[File:RPi_uionmodelb+.JPG|200px|thumb|right|The Raspberry Pi UI with RTC module on the new Model B+]]
The model with RTC unit has a problem: the battery enclosure touches the middle USB ports, preventing the board from fitting properly into the GPIO pins. The version without RTC fits better, however the Raspberry Pi's mounting holes are covered. The board functions as normal
= [[User_Interface|Raspberry Pi UI 20x4]] =
The 20x4 UI has the same problem with the battery compartment as its smaller brother. On the other side, the mounting holes of the RPi UI are not blocked.
= [[Raspduino]] =
The Raspduino fits on the new model. The mounting holes are again covered.
5eeccb49652f8fb66f52a69f6ef9d569917f06ba
File:RPi uionmodelb+.JPG
6
1704
2847
2014-07-16T12:39:26Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Rpicamextstraight.jpg
6
1698
2850
2815
2014-07-16T14:14:34Z
Rijk
2525
uploaded a new version of "[[File:Rpicamextstraight.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Beginners guide to SPI on Raspberry Pi
0
794
2851
2835
2014-07-16T15:48:07Z
Rijk
2525
/* Next steps */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_tool program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -r 16 -v 0
Now your display should be cleared. <br>
See also the [[bw_tool| bw_tool wiki page ]].
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
b9ec47e8302aa47606cd0094cfe170e289828fd5
2863
2851
2014-07-21T12:09:16Z
Rijk
2525
/* Next steps */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_tool program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -w 16:0
Now your display should be cleared. <br>
See also the [[bw_tool| bw_tool wiki page ]].
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can email us, or post your problem in our forum. We will respond as soon as we can.
ff40417cf49f3057632a07e2873115dec2925251
Motor protocol
0
657
2852
2779
2014-07-17T14:44:15Z
Tom
4
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the motor board will be explained on this page.
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The motor board will ignore any transactions on the bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction X with intensity <byte>
|-
| 0x21 || Spin motor A in direction Y with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction X with intensity <byte>
|-
| 0x31 || Spin motor B in direction Y with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|-
| 0x58 || set PWM value for all four outputs as a single 32-bit value.
|}
= read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| 0x20 || Read back intensity and direction of motor A
|-
| 0x21 || Read back intensity and direction of motor A
|-
| 0x30 || Read back intensity and direction of motor B
|-
| 0x31 || Read back intensity and direction of motor B
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|-
| 0x58 || get all 4 PWM values as a 32-bit value.
|}
= examples =
== read identification ==
read the identification string of the board. (motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
528a444b92c802ffa1a4a5c918a23bf9318c4030
Main Page
0
1
2853
2833
2014-07-18T11:40:44Z
Rijk
2525
/* General */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
94e22bb94a84b204d23dcd97b127c52bb1200911
2870
2853
2014-07-21T13:37:04Z
Rijk
2525
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
c546899269cb0135ad1d2786f2b65f598e198946
SPI versus I2C protocols
0
673
2854
2838
2014-07-18T12:31:54Z
Rijk
2525
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Physical Differences =
The first difference between I2C and SPI is that I2C is two-wire, while SPI is four-wire.
= Technical Differences =
The I2C protocol is inherently half-duplex. The SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With these dummy packets, both protocols are now half-duplex.
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
I2C has a feature called 'clock stretching'. If the slave device cannot send the data fast enough, it can hold down the clock so data will be transfered slower. This way, the bitrate is decreased, but the slave can keep up with the processing of the data. This feature can be very useful, since the clock rate can be high, and the slave will delay only when it needs to. The only problem is that the SoC on the Raspberry Pi has a bug in this feature. This bug makes clock stretching unusable on the RPi. All BitWizard I2C boards work around this issue by carefully timing all I2C messages. The performance penalty is small, but as a result, all BitWizard I2C boards only work at a bus speed of 100kHz.
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
e30b3fb3d4a6b65986e0f892e9e7d3da83aa9677
2855
2854
2014-07-18T12:41:04Z
Rijk
2525
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Physical Differences =
The only physical difference between I2C and SPI is that I2C is two-wire, while SPI is four-wire.
= Technical Differences =
== Full-duplex/Half-duplex
The I2C protocol is inherently half-duplex. The SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With dummy packets, both protocols are essentially half-duplex.
== I2C Clock stretching ==
I2C has a feature called 'clock stretching'. If the slave device cannot send the data fast enough, it can hold down the clock so data will be transfered slower. This way, the bitrate is decreased, but the slave can keep up with the processing of the data. This feature can be very useful, since the clock rate can be high, and the slave will delay only when it needs to. The only problem is that the SoC on the Raspberry Pi has a bug in this feature. This bug makes clock stretching unusable on the RPi. All BitWizard I2C boards work around this issue by carefully timing all I2C messages. The performance penalty is small, but as a result, all BitWizard I2C boards only work at a bus speed of 100kHz.
== Implentation ==
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
2c766ba10bf0b3614ef0c7f4a4f8518ad6c25ef2
2856
2855
2014-07-18T12:41:17Z
Rijk
2525
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Physical Differences =
The only physical difference between I2C and SPI is that I2C is two-wire, while SPI is four-wire.
= Technical Differences =
== Full-duplex/Half-duplex ==
The I2C protocol is inherently half-duplex. The SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With dummy packets, both protocols are essentially half-duplex.
== I2C Clock stretching ==
I2C has a feature called 'clock stretching'. If the slave device cannot send the data fast enough, it can hold down the clock so data will be transfered slower. This way, the bitrate is decreased, but the slave can keep up with the processing of the data. This feature can be very useful, since the clock rate can be high, and the slave will delay only when it needs to. The only problem is that the SoC on the Raspberry Pi has a bug in this feature. This bug makes clock stretching unusable on the RPi. All BitWizard I2C boards work around this issue by carefully timing all I2C messages. The performance penalty is small, but as a result, all BitWizard I2C boards only work at a bus speed of 100kHz.
== Implentation ==
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
922207445b8f5453f249b74422851df5fa70382c
2857
2856
2014-07-18T12:41:48Z
Rijk
2525
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Physical Differences =
The only physical difference between I2C and SPI is that I2C is two-wire, while SPI is four-wire.
= Technical Differences =
== Full-duplex/Half-duplex ==
The I2C protocol is inherently half-duplex. The SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With dummy packets, both protocols are essentially half-duplex.
== I2C Clock stretching ==
I2C has a feature called 'clock stretching'. If the slave device cannot send the data fast enough, it can hold down the clock so data will be transfered slower. This way, the bitrate is decreased, but the slave can keep up with the processing of the data. This feature can be very useful, since the clock rate can be high, and the slave will delay only when it needs to. The only problem is that the SoC on the Raspberry Pi has a bug in this feature. This bug makes clock stretching unusable on the RPi. All BitWizard I2C boards work around this issue by carefully timing all I2C messages. The performance penalty is small, but as a result, all BitWizard I2C boards only work at a bus speed of 100kHz.
== Implementation ==
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
09494b8bb9aea86bf6df9ce2aac5087cbb833a38
2858
2857
2014-07-18T12:43:00Z
Rijk
2525
/* Full-duplex/Half-duplex */
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Physical Differences =
The only physical difference between I2C and SPI is that I2C is two-wire, while SPI is four-wire.
= Technical Differences =
== Full-duplex/Half-duplex ==
The I2C protocol is inherently half-duplex, while the SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With dummy packets, both protocols are essentially half-duplex.
== I2C Clock stretching ==
I2C has a feature called 'clock stretching'. If the slave device cannot send the data fast enough, it can hold down the clock so data will be transfered slower. This way, the bitrate is decreased, but the slave can keep up with the processing of the data. This feature can be very useful, since the clock rate can be high, and the slave will delay only when it needs to. The only problem is that the SoC on the Raspberry Pi has a bug in this feature. This bug makes clock stretching unusable on the RPi. All BitWizard I2C boards work around this issue by carefully timing all I2C messages. The performance penalty is small, but as a result, all BitWizard I2C boards only work at a bus speed of 100kHz.
== Implementation ==
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
67a0fb6f592ac7f9af4428dbb630e73b119a85bc
2859
2858
2014-07-18T12:45:20Z
Rijk
2525
/* I2C Clock stretching */
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Physical Differences =
The only physical difference between I2C and SPI is that I2C is two-wire, while SPI is four-wire.
= Technical Differences =
== Full-duplex/Half-duplex ==
The I2C protocol is inherently half-duplex, while the SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With dummy packets, both protocols are essentially half-duplex.
== I2C Clock stretching ==
I2C has a feature called 'clock stretching'. If the slave device cannot send the data fast enough, it can hold down the clock so data will be transfered slower. This way, the bitrate is decreased, but the slave can keep up with the processing of the data. This feature can be very useful, since the clock rate can be high, and the slave will delay only when it needs to. The only problem is that the SoC on the Raspberry Pi has a bug in this feature. If clock stretching is used at the wrong time, the received might be corrupt. All BitWizard I2C boards work around this issue by carefully timing all I2C messages. The performance penalty is small, but as a result, all BitWizard I2C boards only work at a bus speed of 100kHz.
== Implementation ==
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
eb2e7cf71a43d5a7803a3635cf563f8d247151bd
2860
2859
2014-07-18T13:31:20Z
Rijk
2525
wikitext
text/x-wiki
When buying a BitWizard expansion board, either I2C or SPI can be selected as the interface. This page will help you choose.
= Introduction =
I2C and SPI are both bus protocols that allow short-distance, serial data transfer. I2C originates from the Philips semiconductor devision, while SPI was created by Motorola. Both protocols are commonly used in electronic devices like smartphones, TV's and laptops to control peripherals like power management chips, input devices and DACs. For instance, Microsoft uses I2C for the detachable keyboard on their Surface tablet.
= Technical Differences =
== General Differences ==
I2C allows multiple masters and slaves on the bus. On the other hand SPI can only work with one master device controlling multiple slaves. In both I2C and SPI the master device controls the clock for all slaves, but an I2C slave device can modify the main bus clock. We will talk about this feature later.
== Full-duplex/Half-duplex ==
The I2C protocol is inherently half-duplex, while the SPI protocol is inherently full-duplex. So with SPI, every read is also a write. This could in theory double the speed of the bus, however, when implementing the SPI protocol we noticed that most of the time we didn't have data to send one direction. When you want to read from the device, you have to send "dummy bytes" to the device to trigger the clock signal that allows the slave to send data. Similarly, most of time the slave does not have anything to report back when you are actually sending data to the slave.
With dummy packets, both protocols are essentially half-duplex.
== I2C Clock stretching ==
I2C has a feature called 'clock stretching'. If the slave device cannot send the data fast enough, it can hold down the clock so data will be transfered slower. This way, the bitrate is decreased, but the slave can keep up with the processing of the data. This feature can be very useful, since the clock rate can be high, and the slave will delay only when it needs to. The only problem is that the SoC on the Raspberry Pi has a bug in this feature. If clock stretching is used at the wrong time, the received might be corrupt. All BitWizard I2C boards work around this issue by carefully timing all I2C messages. The performance penalty is small, but as a result, all BitWizard I2C boards only work at a bus speed of 100kHz.
== Sending/Writing data ==
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. All BitWizard boards will ignore any transactions on the bus that do not start with their own address. The protocols allow for changing the address in case you need more modules of the same type on one bus.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
To write data using SPI or I2C send a number of bytes (usually 3 or 4).
<address> <register> <data byte1> <data byte2> ....
On SPI you activate (make it low!) the slave select line before the transaction. On I2C you cause a start condition before the transaction. After the transaction, you deactivate the slave select line (make it high) on SPI and cause a STOP condition on I2C.
To read data from the slaves, on I2C you first make a write transaction of just two bytes, the address and the register number. Next you read the data. On SPI this must be done in one transaction: write the address and register number, then write dummy bytes while reading the data.
To read on I2C:
<start> <address + WRITE> <register> <stop>
<start> <address + READ> <byte 1> <byte 2>
To read on SPI:
MOSI <address> <register> <dummy byte> <dummy byte>
MISO xxx xxx <byte 1> <byte 2>
5108af26d6eb22836b8a4e3bf8f7892dda81e403
Bw tool
0
1635
2861
2783
2014-07-18T13:59:56Z
Rijk
2525
wikitext
text/x-wiki
= intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. So by default Linux chooses to only allow the root user access to the SPI or I2C bus. So you have the following choices:
* You can run your whole session as root. I use "sudo -s" others recommend "sudo su", while "sudo bash" will also work.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Nowadays the "/dev" filesystem is kept in RAM, not somewhere on disk. So you will need to do that again, at every boot. You could add those commmands to your rc.local (in /etc/) to issue them automatically at every boot. Or you can tell udev that you want those devices world writable. I haven't figured out yet how to do that exactly, so if you want to do the research, feel free to do it that way and report how it's done. (just create a WIKI account and add it here yourself or you can Email to info@ ... and let me do that.)
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. This second i2c bus is the one that is broken out on the gpio's of rev2 raspberry pi's.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that bitwizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
d82f12d6a5ca3057f1c6108df0a6fd759509df46
2862
2861
2014-07-21T12:01:25Z
Rijk
2525
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. So by default Linux chooses to only allow the root user access to the SPI or I2C bus. So you have the following choices:
* You can run your whole session as root. I use "sudo -s" others recommend "sudo su", while "sudo bash" will also work.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Nowadays the "/dev" filesystem is kept in RAM, not somewhere on disk. So you will need to do that again, at every boot. You could add those commmands to your rc.local (in /etc/) to issue them automatically at every boot. Or you can tell udev that you want those devices world writable. I haven't figured out yet how to do that exactly, so if you want to do the research, feel free to do it that way and report how it's done. (just create a WIKI account and add it here yourself or you can Email to info@ ... and let me do that.)
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, an I2C Raspberry Pi UI connected could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
1ebd999f1dc9cb1881c09d1893e15aa8c76be034
2864
2862
2014-07-21T12:09:49Z
Rijk
2525
/* Identifying the Device */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. So by default Linux chooses to only allow the root user access to the SPI or I2C bus. So you have the following choices:
* You can run your whole session as root. I use "sudo -s" others recommend "sudo su", while "sudo bash" will also work.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Nowadays the "/dev" filesystem is kept in RAM, not somewhere on disk. So you will need to do that again, at every boot. You could add those commmands to your rc.local (in /etc/) to issue them automatically at every boot. Or you can tell udev that you want those devices world writable. I haven't figured out yet how to do that exactly, so if you want to do the research, feel free to do it that way and report how it's done. (just create a WIKI account and add it here yourself or you can Email to info@ ... and let me do that.)
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
580bbb7306cefe475d7dc0a586e0dc091a42de45
2865
2864
2014-07-21T13:07:21Z
Rijk
2525
/* About Permissions */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the raspberry pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
5b78137c679df1445c673a2dae1cfcc606c46423
2866
2865
2014-07-21T13:08:56Z
Rijk
2525
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
5afb39c01318af04099a3543925395338a444087
2867
2866
2014-07-21T13:28:10Z
Rijk
2525
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
== Setting up I2C/SPI under Linux ==
To get Linux to work with SPI/I2C the proper modules need to be loaded. To do this automatically on boot:
'''0''': (on Raspberry Pi) edit /etc/modprobe.d/raspi-blacklist.conf to look like this:
# blacklist spi and i2c by default (many users don't need them)
#blacklist spi-bcm2708
#blacklist i2c-bcm2708
'''1''': Add the following lines to /etc/modules:
i2c-dev
spidev
'''2''': Reboot
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
2a9061be56a133e14ba48bd1299a512d5499a0b7
User Interface
0
1505
2868
2688
2014-07-21T13:32:42Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
=== Related projects ===
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0db8d647c6b6565e57c4fcf03cfdb2ef394a25f0
2869
2868
2014-07-21T13:33:10Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -r 16 -v 0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -r 17 -v 0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -r 17 -v 32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
896383f3c9962c120049629c6873aaa17e4810e6
2879
2869
2014-07-28T11:53:27Z
Rijk
2525
/* bash script to show system informations */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works, I haven't really tested what the limit is).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -w 16:0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -w 17:0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -w 17:32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
39e5136b3058921480d8ed3ba1092bf60474a779
Relay
0
53
2871
2559
2014-07-21T13:40:12Z
Rijk
2525
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[[http://www.tianbo-relay.com/bigimg/18.pdf| Relay datasheet ]]
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
e97913418016c62ce873b72ee3213a11aadb6c74
2872
2871
2014-07-21T13:40:27Z
Rijk
2525
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
This is the documentation page for the SPI_relay and I2C_relay boards.
== Overview ==
This board enables you to drive two relays.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.tianbo-relay.com/bigimg/18.pdf| Relay datasheet ]
== Additional software ==
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
=== LEDs ===
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[spi_dio_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== additional considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a raspberry pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the raspberry pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
f06817b49fe630591cdddb7e38649724caa49316
2875
2872
2014-07-21T14:01:35Z
Rijk
2525
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO protocoll]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
=== Related projects ===
* [[Temperature_control]]
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== External resources ==
=== Datasheets ===
[http://www.tianbo-relay.com/bigimg/18.pdf| Relay datasheet ]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
a8a1f1b53b14527787a62dc01906cf5b56976f65
2876
2875
2014-07-21T14:01:59Z
Rijk
2525
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO protocoll]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
[http://www.tianbo-relay.com/bigimg/18.pdf| Relay datasheet ]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
e76cdddd6e57274a16da6356d6b4785b5524ab3b
2877
2876
2014-07-21T14:04:08Z
Rijk
2525
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the raspberry pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the 'pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
[http://www.tianbo-relay.com/bigimg/18.pdf| Relay datasheet ]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
6f5c275c930b53552be42499e6505b423a83e8cc
2878
2877
2014-07-21T14:06:10Z
Rijk
2525
/* Additional Considerations */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
[http://www.tianbo-relay.com/bigimg/18.pdf| Relay datasheet ]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
06492de1c972fc2c792983f0ad9536a966ef6ffc
File:Bigrelay.jpg
6
1705
2873
2014-07-21T13:47:14Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
DIO protocol
0
432
2874
2788
2014-07-21T13:56:13Z
Rijk
2525
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || || || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
211ac57fef3d03a32d27879f4556afea59019ebe
Raspberry Juice
0
1699
2880
2829
2014-07-31T13:33:02Z
Rew
3
/* Use */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time.
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Use =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
9d93e7b552824b2d5f3f03124d8c564fb68a24da
Raspduino
0
1572
2881
2376
2014-08-11T14:42:36Z
Rijk
2525
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for headless servers.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program for the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
... and initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c that blink the led can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c here]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
acad39bb4ae0843d6e3d81c8c06639b720a9cc0e
2882
2881
2014-08-11T14:46:04Z
Rijk
2525
/* Using PlatformIO */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program for the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
... and initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c that blink the led can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c here]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
025dfd6e45c4cb3aea7c2f05141041ccc1c6cf82
2883
2882
2014-08-11T14:46:16Z
Rijk
2525
/* Using PlatformIO */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program for the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
... and initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c that blink the led can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c here]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
b49855ef81917975d36f00b1478e95db27532e59
2884
2883
2014-08-11T14:48:09Z
Rijk
2525
/* Using PlatformIO */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program for the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
... and initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c that blink the led can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c here]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
83600fe081199cf382197d371bd6f7f4d8439de6
2885
2884
2014-08-11T14:49:13Z
Rijk
2525
/* Using PlatformIO */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
... and initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c that blink the led can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c here]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
f84926c4196d47629d04714dfcba0959ca905864
2886
2885
2014-08-11T14:49:37Z
Rijk
2525
/* Creating a Project */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c that blink the led can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c here]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
603ae54460b4e9d012fb1684b18432895eeb9bac
2887
2886
2014-08-11T14:50:01Z
Rijk
2525
/* Creating a Project */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c that blinks the led can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c here]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
6e6574bce92b8fc63fccdbfa3bed134af4fdd3ff
2888
2887
2014-08-11T14:54:02Z
Rijk
2525
/* Creating a Project */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c written in Arduino Wiring can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/wiring-blink/src/main.c here]. An AVR native version is also [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c provided]. More can be found are in among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
8ebadd930bb1f4ee72e744075cbe114f19cf2b13
2889
2888
2014-08-11T14:54:28Z
Rijk
2525
/* Creating a Project */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c written in Arduino Wiring can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/wiring-blink/src/main.c here]. An AVR native version is also [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c provided]. More can be found among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
a1f7293884c7cdf359b6374bfe594c2f146bae03
2890
2889
2014-08-11T15:16:07Z
Rijk
2525
/* Using PlatformIO */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
=== Setup ===
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c written in Arduino Wiring can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/wiring-blink/src/main.c here]. An AVR native version is also [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c provided]. More can be found among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
1afee479d192bb4f53f1c148f62441f994e3ebba
2891
2890
2014-08-11T15:16:36Z
Rijk
2525
/* Creating a Project */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/catalog/product_info.php?products_id=126 BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
=== Setup ===
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
=== Running the Project ===
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c written in Arduino Wiring can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/wiring-blink/src/main.c here]. An AVR native version is also [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c provided]. More can be found among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
20f285139a97417c67187ba1d0c6ee5fbe68b50f
Raspberry Pi Serial
0
59
2892
2207
2014-08-14T14:11:03Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
=== signal levels ===
Many expansion boards that you might want to connect to your raspberry pi will be 5V, whereas the Raspberry Pi works at 3.3V. To convert the signal levels you need a level shifter.
For I2C the board implements a level shifter as recommended by Philips (inventor of I2C).
For SPI and UART the 3.3V signals coming out of the Raspberry Pi are sufficiently high that all 5V devices that we could find recognized the signal as high. For the 5V signals going to the Raspberry Pi, we have limited the voltage to just above 3.3V by putting a scottky diode from the signal to the 3.3V, as well as a 1k resistor to limit the current. This sufficiently protects the raspberry pi from damage by the 5V signals from 5V devices.
Some care should be taken: The 5V device should NOT drive the signals that are normally driven by the raspberry pi. Normally you'd have two outputs driving against eachother, now there is also the 5V vs 3.3V issue....
== Pinout ==
The 26 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools .
git clone https://github.com/rewolff/bw_rpi_tools.git
Now, you can use the tools in either the SPI or I2C subdirectory to communicate with bitwizard SPI or I2C boards that you might have.
== getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== changelog ===
* Initial public release
77f872ae4ed4d82dcd8e3a5dc69bd58cb235bde6
Reducing power consumption of a raspberry Pi
0
802
2893
2698
2014-08-18T10:27:48Z
Rijk
2525
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [http://www.bitwizard.nl/catalog/product_info.php?cPath=26&products_id=99 | switching regulator from our shop]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work are devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
3f25d1ec63f3fdbf9ffc071ac49ded8defd2c1ee
Reducing power consumption of a raspberry Pi
0
802
2894
2893
2014-08-18T10:28:14Z
Rijk
2525
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [http://www.bitwizard.nl/catalog/product_info.php?cPath=26&products_id=99 switching regulator from our shop]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work are devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
39354ee335a723ef47f8a2656928cf8c5947e31a
2895
2894
2014-08-18T10:49:01Z
Rijk
2525
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [http://shop.bitwizard.nl/power-heat/dc-dc-step-down-conv switching regulator from our shop]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work are devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
7d0e8ab01f1404328d73ee6094789110fdda68c1
2896
2895
2014-08-18T11:26:12Z
Rijk
2525
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [https://bitwizard.nl/shop/power-heat/dc-dc-step-down-conv switching regulator from our shop]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work are devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
f2add5b6b85de91457676c0400610f0e72e4ea1d
2897
2896
2014-08-18T11:27:43Z
Rijk
2525
/* Introduction */
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [http://bitwizard.nl/shop/power-heat/dc-dc-step-down-conv switching regulator from our shop]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work are devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
3ad0937e85f4fe3c353939667f89e19a1926504f
2898
2897
2014-08-18T11:59:39Z
Rijk
2525
wikitext
text/x-wiki
= Introduction =
The Raspberry Pi relies on a linear regulator for its 3V3 rail. This dissipates a third of the energy as heat, which is a bit of a waste, if you want to power your Pi from an battery. Our solution: Replace the linear regulator with a [http://www.bitwizard.nl/shop/power-heat/dc-dc-step-down-conv switching regulator from our shop]. We also used another regulator for the 5V power, to test powering a Pi from a car battery.
[[File:switcher.jpg|none|thumb|300px|alt=One of our switching regulators|One of our switching regulators]]
= Initial measurements =
We tuned our benchtop power supply to 12V DC, and set the current-limit to approximately 400mA. Then we adjusted one of the switching regulators to 5V, and labelled it. We gave our Pi an SD card, and ethernet connection. We then hooked up the power to the Pi, on its GPIO header (GND on pin6, 5V on pin2). After booting, the current consumption from the benchtop supply stabilized between 190 and 200mA, which translates to a power consumption of about 2,4W.
= Slicing the Pi =
To make sure the linear regulator stopped wasting power, we completely removed it from our Pi, with a hot air rework station. To do this, we grip the regulator with some metal tweezers, lift the Pi about a centimetre, and then blast the regulator with air at about 400 degrees Celsius. After a few seconds, the Pi drops to the table, and the regulator was removed:
[[File:No_LM1117.jpg|none|thumb|300px|alt=There used to be an LM1117-33 at this spot...|There used to be an LM1117-33 at this spot...]]
= Decorating the Pi =
We adjusted a second switcher to 3,3V and connected both the 5V and 3V3 switchers to the GPIO header of the Pi (with the benchtop power supply still turned off); 3V3 on pin1, 5V on pin2, GND on pin6.<br>
[[File:2regulators.jpg|none|thumb|300px|alt=The two regulators connected to the Pi|The two regulators connected to the Pi]]
The Pi also got the same SD card and ethernet connection as with the initial measurements.<br>
We double/triple checked everything, crossed our fingers, and turned on the benchtop supply. After booting, the power consumption settled on 150mA at 12V, a 25% improvement!
[[File:benchtop.jpg|none|thumb|300px|alt=The resulting current draw|The resulting current draw]]
[[File:Final_setup.jpg|none|thumb|300px|alt=The final working setup|The final working setup]]
= Further reduction =
A further power reduction can be achieved by tying the 5V and 3V3 lines both to the 3.3V DCDC converter (and obviously removing the 5V one). Everything that depends on the 5V will stop working, but most of the 'pi will work. What won't work are devices depending on the 5V powersupply on the GPIO, HDMI and the USB connectors.
= Conclusion =
If you're not afraid of modifying your Raspberry Pi, and want to power it from a limited power source, such as a battery or solar panel, it's well worth the trouble and cost of replacing the linear regulator by a switching one. The only downside is that the extra regulator takes up a little extra room.
0b1f6e56749e17ee6261a1893ccf517a5b8dba14
Raspberry Juice
0
1699
2899
2880
2014-08-18T15:00:59Z
Rijk
2525
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Use =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
59a0baf9337f52a3da4486935359834aecc7d470
Bw tool
0
1635
2901
2867
2014-08-20T14:03:22Z
Rijk
2525
/* Setting up I2C/SPI under Linux */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal people can find it:
''make install''
== Setting up I2C/SPI under Linux ==
To get Linux to work with SPI/I2C the proper modules need to be loaded. To do this automatically on boot:
'''0''': (on Raspberry Pi) edit /etc/modprobe.d/raspi-blacklist.conf to look like this:
# blacklist spi and i2c by default (many users don't need them)
#blacklist spi-bcm2708
#blacklist i2c-bcm2708
'''1''': Add the following lines to /etc/modules:
i2c-dev
spidev
'''2''': Reboot
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
0a246fa9cec8030595fcf701d87bdd22b9ff9ee0
User Interface
0
1505
2902
2879
2014-08-20T14:05:12Z
Rijk
2525
/* SPI */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz works).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -w 16:0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -w 17:0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -w 17:32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
3858cb8d3fba749d1cbb2c8d930cf20200e1785f
2903
2902
2014-08-20T14:05:36Z
Rijk
2525
/* SPI */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -w 16:0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -w 17:0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -w 17:32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
e4be85b088f9ccc78241cbe5f6772e2edf4fab9c
2904
2903
2014-08-20T14:06:45Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
The User Interface can be equipped with either an SPI RTC or an I2C RTC.
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the commandline using the raw SPI bytes commandline option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -w 16:0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -w 17:0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -w 17:32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
5b80a648d49a3d201cd09e0514e52f96a6ed0f2f
File:RPiRelay.jpg
6
1707
2905
2014-08-22T14:32:05Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Raspberry Relay
0
1708
2906
2014-08-22T14:43:10Z
Rijk
2525
Created page with "[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]] == Overview == The Raspberry Relay board can be connected to a Raspberry Pi using t..."
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side.
3a02a589c2c557d6af0a9954d984522eff4bd238
2907
2906
2014-08-22T14:55:06Z
Rijk
2525
/* Overview */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
b87e995e49366535b47ec0f4388954bda069a75c
2908
2907
2014-08-25T12:37:39Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO27 || 2
|-
| 4 || 15 || GPIO22 || 3
|}
9f2732f8f67d4e1cc1a6ea66462fc0ee126e82b2
2909
2908
2014-08-25T12:56:03Z
Rijk
2525
/* Usage */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
f2b41b936c7e00a13d5376792aad420a92b500c6
2911
2909
2014-08-25T13:11:16Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD]
442221942bb11125e2e6ff7070013bb801627895
2912
2911
2014-08-25T14:02:42Z
Rijk
2525
/* Datasheets */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
89a3b95df36dc07c3aa93ce3c5a2dd5611b3df41
2913
2912
2014-08-25T14:18:55Z
Rijk
2525
/* Datasheets */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
92edf480bd02603d40cceca9399050e8735c6b63
2914
2913
2014-08-25T14:35:21Z
Rijk
2525
/* Usage */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
= Shell =
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
= Python =
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
c1aab631bc1af7bd4817f2e87458e3a4d2de2836
2915
2914
2014-08-25T14:36:22Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
dbd6f2ee4878acb890cf851b13d60074fdf01680
2917
2915
2014-08-25T15:20:00Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a Relay output pin.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
c36680c866d7265ed2080a4fd19b5eee0048b20d
2919
2917
2014-08-27T11:48:14Z
Rijk
2525
/* Pinout */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
742940d1c2498e9df4a4e24248b02bfc63ba9766
2930
2919
2014-08-27T13:33:22Z
Rijk
2525
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. It can be found in the shop [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay here].
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
25c7df61aca9034ef248adcd39032e448c8355ae
2931
2930
2014-08-27T13:44:19Z
Rijk
2525
/* Overview */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. It can be found in the shop [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay here].
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
7ae1444c6a66fda33e35e86e751bd78d39a78622
2933
2931
2014-08-27T14:23:04Z
Rijk
2525
/* Pinout */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. It can be found in the shop [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay here].
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number !! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
80c55532f76c07d5cbbde3513b35ef88fcbdd6da
2934
2933
2014-08-27T14:34:34Z
Rijk
2525
/* Usage */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. It can be found in the shop [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay here].
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
d8dc05443b794b5dcff95e59f0774675d4464a9d
Main Page
0
1
2910
2870
2014-08-25T12:58:17Z
Rijk
2525
/* Board specific pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|relay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
f5e2c6b1c13483901b6d4061591810f8efa2dac8
2921
2910
2014-08-27T12:29:23Z
Rijk
2525
/* Board specific pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|temp]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
2c4130ae7e5c019ac2d23e0efd7a39e0538e4236
2928
2921
2014-08-27T12:47:23Z
Rijk
2525
/* Board specific pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
55400000b1139c0f3ccd56a63b0d838be4250bfd
2936
2928
2014-09-11T14:47:50Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT201X]]
* [[FT220X]]
* [[FT221X]]
* [[FT320X]]
* [[FT231X]]
* [[FT240X]]
* [[FT245R V1.5]]
* [[FT211D]]
* [[FT312D]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
a6aadc24acc54a2fb0e43b04b111ad2db04869b6
2939
2936
2014-09-16T15:02:20Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT201X]]
* [[FT220X]]
* [[FT221X]]
* [[FT320X]]
* [[FT231X]]
* [[FT240X]]
* [[FT245RL V1.5]]
* [[FT211D]]
* [[FT312D]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
bfee8857b0461000af0ce7f832cd2488c5bdc3bd
2943
2939
2014-09-16T15:27:19Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT201X]]
* [[FT220X]]
* [[FT221X]]
* [[FT230X]]
* [[FT231X]]
* [[FT240X]]
* [[FT245RL V1.5]]
* [[FT211D]]
* [[FT312D]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
da1f7fba220353c9a82a33f64eb763fb2a42c9ff
File:RPiRelayPinout.jpg
6
1709
2916
2014-08-25T15:06:18Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Relay
0
53
2920
2878
2014-08-27T11:49:47Z
Rijk
2525
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C
* 2 - 5V for the relays
* 1 - GND
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
698bf7f67e8cb4616843140cb6a86f95e2c749f3
Temperature Interface
0
51
2922
2677
2014-08-27T12:31:00Z
Rijk
2525
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ae38362056aa93ed11df4ea1c59ea9596a8af8aa
2923
2922
2014-08-27T12:33:14Z
Rijk
2525
moved [[Temp]] to [[Temperature Interface]]
wikitext
text/x-wiki
[[File:.jpg|thumb|300px|alt=|]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ae38362056aa93ed11df4ea1c59ea9596a8af8aa
2926
2923
2014-08-27T12:39:49Z
Rijk
2525
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of say 80 degrees C, so officially it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
d3ddbcf32bdc7f2765a0f68656f9cb7d9b7370dd
2927
2926
2014-08-27T12:41:58Z
Rijk
2525
/* Assembly instructions */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5dac3697bcb66561c711ef61ed939ee7aa5776bb
Temp
0
1711
2924
2014-08-27T12:33:14Z
Rijk
2525
moved [[Temp]] to [[Temperature Interface]]
wikitext
text/x-wiki
#REDIRECT [[Temperature Interface]]
ba78870303c9be3f137627816b0b929931db15b6
File:Tempic.jpg
6
1712
2925
2014-08-27T12:38:36Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Usbio ACM sample program
0
4
2929
821
2014-08-27T12:47:53Z
Rijk
2525
wikitext
text/x-wiki
== USBIO sample ACM program ==
The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board.
Under Linux if you connect your usbio board when it is loaded with this program, you will get a /dev/ttyACM0 device.
Under windows you will have to follow the directions of the LUFA documentation which include downloading and using the INF file located: https://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/LUFA%20VirtualSerial.inf?r=1607
The LUFA explanation is here: http://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt?spec=svn1470&r=1470
Once you have the driver sorted, you can use any terminal program you like to connect with the board. I use "kermit" to communicate with serial devices like this. There are several other programs available, but I'm used to kermit. Under windows there is a program called hyperterm.
Once you connect to the device, you will be prompted with a welcome string and a prompt. You can use several commands:
=== s ===
if you type s<outputnumber> the output with that number will go high. Outputnumber is in hex. For usbio the output numbers go from 0 to f. For example s5 will turn on output 5.
=== c ===
if you type c<outputnumber> the output with that number will be cleared. For example: ce will clear output 14 (which is e in hex).
=== a ===
If you type a<output> <value> the output will be put in software pwm mode. Currently values 0...80 are supported (128 levels).
=== p ===
If you type p <output> <length> the output with that number will be pulsed for <length> ms. The length is of course in hex.
=== z ===
If you type "z" the board will reset into firmware-upload-mode.
== download ==
You can download the source from: http://www.bitwizard.nl/software/usbio.tgz
You then need to download LUFA, and place it in the directory usbio/../LUFA (i.e. next to the usbio directory).
== future enhancements ==
In the future we'll enhance the program to allow setting the mode of pins to inputs. And the program should be able to monitor the inputs value, and report the state changes as they happen. Also on-demand questioning of the inputs should become possible.
80aaaa4f354b63d09c00f548287c3d2cf7e3550d
File:Dsc05646 small.jpg
6
1713
2932
2014-08-27T14:22:22Z
Rijk
2525
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Assembling the rpi+rpi ui case.
0
1662
2935
2711
2014-09-11T13:52:31Z
Rew
3
/* V2.1 and newer */
wikitext
text/x-wiki
[[File:Pic_4762_640.jpg|200px|thumb|right|rasbperry pi with ui in case]]
= V2.1 and newer =
We find the following procedure the easiest....
The terms front/back/top/bottom/left/right refer to the position of the assembly with the screen on top and the switches facing you. So the front is the side with the audio and video connector, back is where the HDMI connector lives. (as depicted in the picture on the right).
Screw two M3x10mm screws into the two standoffs. Next place these into the key-hole-shaped holes in the rpi_ui. After inserting the screw you can tighten the standoff onto the PCB by turning it. Don't tighten them too strongly. (so far I've always been able to unscrew them without trouble, but you want to be able to slide them sideways because you can't reach the screw on top.)
Next mount the rpi_ui onto the raspberry pi.
Next you can use the 4mm standoffs and the M3x12 screws (*) to bolt the bottom plate to the raspberry pi and rpi_ui. Sometimes you'll have to nudge the big standoffs a bit to get the to align enough with the holes in the 'pi. Next put the two small keys (the ones without the circular cutout for the TV connector) into the bottom. Next place the top plate on the rpi_ui and fit it into the keys. The top of the case is ALMOST symmetrical. If the buttons don't fit as nicely as they should, try it the other way around (inside-out).
Now you can mount the back plate and fixate it with the two M3x6 screws. Don't tighten them all the way. At this point some play is necessary. Now insert the front key, the one with the cutout for the TV connector between the top and bottom plates in the front.
Next the sides can be mounted, followed by the front. Fixate the front and then tighten all three screws. But be careful the acrylic is easily damaged by tightening the screws too far.
(*) or M3x15.
= V2.1 and newer with raspberry pi B+ =
We find the following procedure the easiest....
The terms front/back/top/bottom/left/right refer to the position of the assembly with the screen on top and the switches facing you. So the front is the side with the GPIO connector, back is where the HDMI connector lives. (as depicted in the picture on the right).
Screw the raspberry pi onto the bottom of the acrylic case with four M3x10 screws. I find it easiest to do the screws one-by one and not tightening the screws all the way until they are all mounted provisionally. The screws are M3, the holes in the raspberry pi are officially M2.5. This means that the screws will self-thread the holes. If turning the screw becomes too difficult, you can widen the hole in the raspberry pi a little with a knife or another sharp tool. With Three of the nylon 18mm standoffs would clash with something on the user-interface. So we recommend just mounting the standoff nearest the usb-power-connector of the raspberry pi. Just leave the other three screwed into the 'pi.
Next mount the rpi_ui onto the raspberry pi. Take care to put the ui on the right pins of the GPIO connector: the ones furthest away from the USB and Ethernet connectors.
Next put the two of the small keys, one has a big hole for the usb power connector into the bottom. Next place the top plate on the rpi_ui and fit it into the keys. The top of the case is ALMOST symmetrical. If the buttons don't fit as nicely as they should, try it the other way around (inside-out).
Now you can mount the back plate and fixate it with the two M3x6 screws. Don't tighten them all the way. At this point some play is necessary. Now insert the front key between the top and bottom plates near the GPIO connector.
Next the sides can be mounted, followed by the front. Fixate the front and then tighten all three screws. But be careful the acrylic is easily damaged by tightening the screws too far.
(*) or M3x15.
= V2.0 and older =
To assemble your rpi+rpi_ui case you the following procedure is the easiest.
Use the screws, the MDF spacers, and the long bolts to connect the raspberry pi to the baseplate of the case. Add the rpi_ui onto the raspberry pi with the spacers. Alas, you cannot do this if you have a V1 raspberry pi. There are holes in the rpi_ui display to bolt the display onto the long nuts that we've just placed. Alas, it is impossible to get a screw through the hole below the display. And the other screw-hole interferes with the jumper block that might be present there. You can chose to put just a short piece of M3 thread into the hex pole, so that at least the position is fixed. In case you want the jumper block installed, you can cut off the side of a nylon M3 bolt to make it fit next to the jumper block. (If you want to do this, you have to screw the nut to the rpi_ui first, and only then add the rpi_ui to the raspberry pi and then finish screwing in the screw from the bottom for that position. )
Next we can start to assemble the case. Find the two small "lock" bits and place them into the bottom on the side that has the RPI's HDMI connector. Next slide the top of the case around the display and put the "lock" parts into their slots. Next add the side of the case which has the HDMI connector cutout. Take care to place it the right way around. Now you can add the screws to keep the lock parts in place. Please be careful: the plastic is not able to withstand the big forces you CAN apply with a screw. I recommend that you don't tighten the screws all the way. This allows for some play during the rest of the assembly. But even then, the case is already starting to get some form.
Next you need to add the lock on the side with the TV and audio connectors.
The next step is to add the USB/ethernet side of the case. And the usb-power and SD-card side.
Then the last side of the case slips on and can be tightened with the third screw.
Now you can finish tightening all the screws.
79ac56e8c25f20873623d06bdc6a589dbb53cb02
FT201X
0
1716
2940
2014-09-16T15:19:57Z
Tom
4
Created page with "This is the documentation page for the FT201X breakout board. == overview == The FT201X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT201X breakout board.
== overview ==
The FT201X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT201X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT201X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT201X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>SCL</td><td>SDA</td></tr>
<tr><td>CBUS5</td><td>CBUS4</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
f383782b20029654c6f2b60ce16160f770a87406
FT220X
0
1717
2941
2014-09-16T15:23:49Z
Tom
4
Created page with "This is the documentation page for the FT220X breakout board. == overview == The FT220X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT220X breakout board.
== overview ==
The FT220X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT220X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT220X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT220X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>MIOSI2</td><td>MIOSI3</td></tr>
<tr><td>MIOSI0</td><td>MIOSI1</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
Please note: On version 1.1 of the boards, the silkscreen markings for MIOSI1 and MIOSI3 are switched!
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
17cf90807400b06ecb2b7a6a82b4fec5a4ab65d1
FT221X
0
1718
2942
2014-09-16T15:26:42Z
Tom
4
Created page with "This is the documentation page for the FT221X breakout board. == overview == The FT221X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT221X breakout board.
== overview ==
The FT221X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT221X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT221X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT221X.html FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>MIOSI7</td><td>MIOSI6</td></tr>
<tr><td>MIOSI5</td><td>MIOSI4</td></tr>
<tr><td>MIOSI3</td><td>MIOSI2</td></tr>
<tr><td>MIOSI1</td><td>MIOSI0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
83fe933369afecf282c065a2192792b899408b11
FT230X
0
1719
2944
2014-09-16T15:29:37Z
Tom
4
Created page with "This is the documentation page for the FT230X breakout board. == overview == The FT230X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT230X breakout board.
== overview ==
The FT230X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT230X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT230X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>RTS</td><td>RXD</td></tr>
<tr><td>TXD</td><td>CTS</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The board is equipped with a power-LED, an Rx-LED and a Tx-LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
a5e2ec43eaf6ce025eaa0dcf40671047b42ec6a7
2945
2944
2014-09-16T15:30:42Z
Tom
4
wikitext
text/x-wiki
This is the documentation page for the FT230X breakout board.
== overview ==
The FT230X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT230X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT230X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>RTS</td><td>RXD</td></tr>
<tr><td>TXD</td><td>CTS</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The board is equipped with a power-LED, an Rx-LED and a Tx-LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
3698b946253316040d0724e9f8650195aa3c1e90
2946
2945
2014-09-16T15:31:59Z
Tom
4
/* pinout */
wikitext
text/x-wiki
This is the documentation page for the FT230X breakout board.
== overview ==
The FT230X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT230X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT230X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>CTS#</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The board is equipped with a power-LED, an Rx-LED and a Tx-LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
96c7db3d68db2ae891a15c82880134a52754a16a
FT231X
0
1720
2947
2014-09-16T15:32:52Z
Tom
4
Created page with "This is the documentation page for the FT231X breakout board. == overview == The FT231X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT231X breakout board.
== overview ==
The FT231X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT231X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT231X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT231X.html FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>RI#</td><td>DCD#</td></tr>
<tr><td>DSR#</td><td>DTR#</td></tr>
<tr><td>CTS#</td><td>RTS#</td></tr>
<tr><td>RXD</td><td>TXD</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
71272f99e9f41b1f739b75bad5cf949d25a538b7
FT240X
0
1721
2948
2014-09-16T15:41:25Z
Tom
4
Created page with "This is the documentation page for the FT240X breakout board. == overview == The FT240X breakout board has an USB connector, one 20-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT240X breakout board.
== overview ==
The FT240X breakout board has an USB connector, one 20-pin IO connector. The brains of the PCB, of course, is an FT240X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT240X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT240X.html FTDI product page]
== pinout ==
The 20-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>VCCIO(jumpered)</td><td>DATA0</td></tr>
<tr><td>DATA1</td><td>DATA2</td></tr>
<tr><td>DATA3</td><td>DATA4</td></tr>
<tr><td>DATA5</td><td>DATA6</td></tr>
<tr><td>DATA7</td><td>RXF#</td></tr>
<tr><td>TXE#</td><td>RD#</td></tr>
<tr><td>WR#</td><td>SI/WU#</td></tr>
<tr><td>CBUS5</td><td>CBUS6</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The only jumper Is for selecting the I/O voltage. 1-2 = 1V8, 2-3 = 3V3.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
b28bc1ad6952e3b54dc7e2d8ed3863422d6380e0
2958
2948
2014-09-16T16:30:56Z
Tom
4
wikitext
text/x-wiki
[[File:FT240X.jpg|thumb|300px]]
This is the documentation page for the FT240X breakout board.
== overview ==
The FT240X breakout board has an USB connector, one 20-pin IO connector. The brains of the PCB, of course, is an FT240X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT240X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT240X.html FTDI product page]
== pinout ==
The 20-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>VCCIO(jumpered)</td><td>DATA0</td></tr>
<tr><td>DATA1</td><td>DATA2</td></tr>
<tr><td>DATA3</td><td>DATA4</td></tr>
<tr><td>DATA5</td><td>DATA6</td></tr>
<tr><td>DATA7</td><td>RXF#</td></tr>
<tr><td>TXE#</td><td>RD#</td></tr>
<tr><td>WR#</td><td>SI/WU#</td></tr>
<tr><td>CBUS5</td><td>CBUS6</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The only jumper Is for selecting the I/O voltage. 1-2 = 1V8, 2-3 = 3V3.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
8604ce57b5b03aa4551e4242e752774847752de9
Main Page
0
1
2949
2943
2014-09-16T15:41:36Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
== Breakout boards ==
* [[FT201X]]
* [[FT220X]]
* [[FT221X]]
* [[FT230X]]
* [[FT231X]]
* [[FT240X]]
* [[FT245RL V1.5]]
* [[FT311D]]
* [[FT312D]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
b41d2e41de98dba8bf946bd06dddca49c83a0b99
2973
2949
2014-09-18T13:01:18Z
Tom
4
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[FT201X]]
* [[FT220X]]
* [[FT221X]]
* [[FT230X]]
* [[FT231X]]
* [[FT240X]]
* [[FT245RL V1.5]]
* [[FT311D]]
* [[FT312D]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[Raspberry Pi Serial]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
eba25a840a0c8324c438f9003540ead756c8bcf0
2974
2973
2014-09-18T13:01:57Z
Tom
4
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]]
* [[FT220X]]
* [[FT221X]]
* [[FT230X]]
* [[FT231X]]
* [[FT240X]]
* [[FT245RL V1.5]]
* [[FT311D]]
* [[FT312D]]
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
3ab1e1ff47a87d2a0622716e9fd6db41d0b5e93a
2977
2974
2014-09-18T13:10:33Z
Tom
4
/* FTDI chips */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host
* [[FT312D]] USB Android host
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
7f7dabbac8b1ec73cffcb59bcc9ed9d839bee3f3
2978
2977
2014-09-18T13:11:30Z
Tom
4
/* FTDI chips */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
7b61a3abe674d3c2ce5a30d29b7388cb6e67b20e
FT311D
0
1722
2950
2014-09-16T15:45:04Z
Tom
4
Created page with "This is the documentation page for the FT311D breakout board. == overview == The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT311D breakout board.
== overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
d0d95fdb35d596b45ffbc41e3e5472275174f5a5
2960
2950
2014-09-16T16:31:12Z
Tom
4
wikitext
text/x-wiki
[[File:FT311D.jpg|thumb|300px]]
This is the documentation page for the FT311D breakout board.
== overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
d45b2a09e132b982371ad5e7b0a9973e3ed4a17d
2971
2960
2014-09-18T12:30:06Z
Tom
4
wikitext
text/x-wiki
[[File:FT311D.jpg|thumb|300px]]
This is the documentation page for the FT311D breakout board.
== overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
0918405743c89897bbc63252a49f49312dc77f51
2976
2971
2014-09-18T13:07:13Z
Tom
4
/* using the board */
wikitext
text/x-wiki
[[File:FT311D.jpg|thumb|300px]]
This is the documentation page for the FT311D breakout board.
== overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with, for example, PodMode.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
b5875025a720d464b697a7963ff85ea621bb485f
2979
2976
2014-09-18T13:12:07Z
Tom
4
/* using the board */
wikitext
text/x-wiki
[[File:FT311D.jpg|thumb|300px]]
This is the documentation page for the FT311D breakout board.
== overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
fb190a1b35d46f5fd24cd22389fc7aedcc477b9e
FT312D
0
1723
2951
2014-09-16T15:47:25Z
Tom
4
Created page with "This is the documentation page for the FT312D breakout board. == overview == The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB,..."
wikitext
text/x-wiki
This is the documentation page for the FT312D breakout board.
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
b0582876b8586016592008513f223af5c4d360ef
2961
2951
2014-09-16T16:31:20Z
Tom
4
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board.
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
d4979fc6b6bae9ff69206e5d8ff1b36cca0f8a72
2972
2961
2014-09-18T12:30:07Z
Tom
4
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board.
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
dd0e234d6db532969ac3674dd538efac498e8dde
2975
2972
2014-09-18T13:07:12Z
Tom
4
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board.
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with, for example, PodMode.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
033847366218d527079805826171c2f8b1bac3c8
2980
2975
2014-09-18T13:12:21Z
Tom
4
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board.
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
2a33dbd2672e340e3830f075bb5452fb6ea403fc
FT245RL V1.5
0
1724
2952
2014-09-16T15:51:32Z
Tom
4
Created page with "This is the documentation page for the FT245RL breakout board. == overview == The FT245RL breakout board has an USB connector, one 16-pin IO connector. The brains of the PC..."
wikitext
text/x-wiki
This is the documentation page for the FT245RL breakout board.
== overview ==
The FT245RL breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT245R.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT245R.htm FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>TXE#</td><td>RXF#</td></tr>
<tr><td>RD#</td><td>WR</td></tr>
<tr><td>D7</td><td>D5</td></tr>
<tr><td>D5</td><td>D4</td></tr>
<tr><td>D3</td><td>D2</td></tr>
<tr><td>D1</td><td>D0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The only jumper is for selecting the I/O voltage. Place the jumper on the left side for 3V3, or on the right side for 5V.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
18c400420e941b2ebfe311867af22a6a489d6e3b
2959
2952
2014-09-16T16:31:03Z
Tom
4
wikitext
text/x-wiki
[[File:FT245RL.jpg|thumb|300px]]
This is the documentation page for the FT245RL breakout board.
== overview ==
The FT245RL breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT245R.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT245R.htm FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>TXE#</td><td>RXF#</td></tr>
<tr><td>RD#</td><td>WR</td></tr>
<tr><td>D7</td><td>D5</td></tr>
<tr><td>D5</td><td>D4</td></tr>
<tr><td>D3</td><td>D2</td></tr>
<tr><td>D1</td><td>D0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The only jumper is for selecting the I/O voltage. Place the jumper on the left side for 3V3, or on the right side for 5V.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
acb2dbf5b62bc05c079f7b79c83f91465bec7bfb
FT220X
0
1717
2953
2941
2014-09-16T16:30:22Z
Tom
4
wikitext
text/x-wiki
[[File:FT220X.jpg|thumb|300px]]
This is the documentation page for the FT220X breakout board.
== overview ==
The FT220X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT220X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT220X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT220X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>MIOSI2</td><td>MIOSI3</td></tr>
<tr><td>MIOSI0</td><td>MIOSI1</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
Please note: On version 1.1 of the boards, the silkscreen markings for MIOSI1 and MIOSI3 are switched!
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
3faf8a64494b0b0bcf64f336b1c5fe664005b13b
FT201X
0
1716
2954
2940
2014-09-16T16:30:23Z
Tom
4
wikitext
text/x-wiki
[[File:FT201X.jpg|thumb|300px]]
This is the documentation page for the FT201X breakout board.
== overview ==
The FT201X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT201X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT201X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT201X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>SCL</td><td>SDA</td></tr>
<tr><td>CBUS5</td><td>CBUS4</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
c8400b1dda02813cafcd4e1a19730e5ca919b501
FT221X
0
1718
2955
2942
2014-09-16T16:30:29Z
Tom
4
wikitext
text/x-wiki
[[File:FT221X.jpg|thumb|300px]]
This is the documentation page for the FT221X breakout board.
== overview ==
The FT221X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT221X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT221X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT221X.html FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>MIOSI7</td><td>MIOSI6</td></tr>
<tr><td>MIOSI5</td><td>MIOSI4</td></tr>
<tr><td>MIOSI3</td><td>MIOSI2</td></tr>
<tr><td>MIOSI1</td><td>MIOSI0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
005cd03cde09f4a155731708806865622baac186
FT230X
0
1719
2956
2946
2014-09-16T16:30:35Z
Tom
4
wikitext
text/x-wiki
[[File:FT230X.jpg|thumb|300px]]
This is the documentation page for the FT230X breakout board.
== overview ==
The FT230X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT230X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT230X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>CTS#</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The board is equipped with a power-LED, an Rx-LED and a Tx-LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
3f9617f0f58c85eb2e1e9aa4b790ac4b7eef05a4
FT231X
0
1720
2957
2947
2014-09-16T16:30:47Z
Tom
4
wikitext
text/x-wiki
[[File:FT231X.jpg|thumb|300px]]
This is the documentation page for the FT231X breakout board.
== overview ==
The FT231X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT231X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT231X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT231X.html FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>RI#</td><td>DCD#</td></tr>
<tr><td>DSR#</td><td>DTR#</td></tr>
<tr><td>CTS#</td><td>RTS#</td></tr>
<tr><td>RXD</td><td>TXD</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
d1a5868866c542f82ce97cf4eb4c563c54f97816
File:FT220X.jpg
6
1725
2962
2014-09-16T16:32:40Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT312D.jpg
6
1726
2963
2014-09-16T16:33:47Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT240X.jpg
6
1727
2964
2014-09-16T16:34:16Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT231X.jpg
6
1728
2965
2014-09-16T16:34:29Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT245RL.jpg
6
1729
2966
2014-09-16T16:34:40Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT230X.jpg
6
1730
2967
2014-09-16T16:34:51Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT201X.jpg
6
1731
2968
2014-09-16T16:35:00Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT311D.jpg
6
1732
2969
2014-09-16T16:35:22Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:FT221X.jpg
6
1733
2970
2014-09-16T16:35:38Z
Tom
4
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Relay
0
53
2987
2920
2014-10-15T10:24:13Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
56195806abbf9793790c6addbb9da268c66e9fc4
2988
2987
2014-10-15T10:25:49Z
Rew
3
/* Additional Considerations */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
9dd77a10b4025556e0fc534f805da111633f3d82
2989
2988
2014-10-16T14:43:17Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software |the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
f7d43f570aa2e201947bbbc80d446f3446125d5c
2990
2989
2014-10-16T14:43:35Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
802e481af6e8214fd0e538b0c176e3a469cfb741
I2C splitter
0
1683
2991
2761
2014-10-24T11:56:32Z
Rew
3
/* using the board */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
b4bcb8c9f849a8749063c7844f0535dbd3513c79
2994
2991
2014-11-06T14:58:09Z
Rew
3
/* using the board */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset 0x70 0x01
to for example select the first bus.
91fdb7c14ebcc2703615d2fff12380aa82ec68e6
2995
2994
2014-11-06T15:50:30Z
Rew
3
/* using the board */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
62247604a8a17873a767a7a695f834d0ad317e2b
2996
2995
2014-11-06T15:52:51Z
Rew
3
/* general info */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
ed6236f210f2756bca02f02486f017b8a3dff7da
USB-SATA powerswitch
0
7
3004
2269
2014-11-28T12:12:22Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads on version 1.1, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo s2 > COM3
sleep -m 200
echo s1 > COM3
sleep -m 200
echo s0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
77f5b1dd5fb09d13c873d69e546366ac7f486cef
3005
3004
2014-11-28T12:12:48Z
Rew
3
/* pinout */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads on version 1.0, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo s2 > COM3
sleep -m 200
echo s1 > COM3
sleep -m 200
echo s0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
eaa01ac4db035b24f85bdfdc05fe8e175c603c08
3009
3005
2014-11-28T14:07:10Z
Rew
3
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
1eec1b53cddae22381533e576f27d34611d711ec
3010
3009
2014-11-28T14:08:00Z
Rew
3
/* future hardware enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
0c1f960b58416486ac6fbb716b3da649b906a15b
3011
3010
2014-11-28T14:14:40Z
Rew
3
/* USB SATA powerswitch */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
f54d7f1cf7e3994f442093cb6fed465114e9105e
Old USB-SATA powerswitch
0
1747
3006
2014-11-28T13:44:10Z
Rew
3
Created page with "= USB SATA powerswitch = This is the documentation page for the USB SATA powerswitch PCB. == overview == The USB SATA powerswitch PCB has an USB connector and connection p..."
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads on version 1.0, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo s2 > COM3
sleep -m 200
echo s1 > COM3
sleep -m 200
echo s0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
0320268419e948d1553292119fa54421363eda8f
3007
3006
2014-11-28T13:45:57Z
Rew
3
moved [[Old USB-SATA powersiwtch]] to [[Old USB-SATA powerswitch]]: typo
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB.
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V OUT (12V IN for V1.1)
* 12V IN (12V OUT for V1.1)
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
Mind the reversed order for the 12V pads on version 1.0, compared to the 5V and 3,3V pads!
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo s0 ; sleep 0.2 ; echo s1 ; sleep 0.2 ; echo s2 ) > $tty
sleep 0.5
kill $pid
"s0" means "set output zero", which is the 12V output. "s1" id the 5V output, and "s2" is the 3V3 output. The four status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "c0", meaning "clear output zero".
Reading from the device is necessary, because it needs to dump its output. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo s2 > COM3
sleep -m 200
echo s1 > COM3
sleep -m 200
echo s0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
0320268419e948d1553292119fa54421363eda8f
Old USB-SATA powersiwtch
0
1748
3008
2014-11-28T13:45:57Z
Rew
3
moved [[Old USB-SATA powersiwtch]] to [[Old USB-SATA powerswitch]]: typo
wikitext
text/x-wiki
#REDIRECT [[Old USB-SATA powerswitch]]
892a45770ffa53a6b8e3390e3da1b25f920c9479
RGB clock
0
25
3013
1074
2014-12-09T13:39:18Z
Rew
3
/* Jump to bootloader */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton of the multio, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
414f80e06108b6cf77f04dfd5b7e99968c2a0e63
RGB clock
0
25
3014
3013
2014-12-09T13:41:13Z
Rew
3
/* Building your own clock-face */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
The laser cutter leaves a bit of brown residue near the laser-cut edges. You can sand this off with a fine sandpaper.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton of the multio, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
0e711037769db158744ff0d45dde7d155cf706f9
3042
3014
2015-02-06T11:15:39Z
Rew
3
/* Connecting the LEDs */
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
The laser cutter leaves a bit of brown residue near the laser-cut edges. You can sand this off with a fine sandpaper.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_back_complete_edit.jpg|none|thumb|300px|alt=The full clock with a few locations marked]]
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton of the multio, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
71abbd81bd1634ebd14e418562b5325dc0070343
Default addresses
0
484
3015
2823
2014-12-16T16:13:33Z
Rew
3
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| [[LCD]] || 0x82
|-
| [[DIO]] || 0x84
|-
| [[Servo]] || 0x86
|-
| [[7FETs]] || 0x88
|-
| [[3FETs]] || 0x8A
|-
| [[temp|Temp]] (sometimes called SPI_LM35) || 0x8C
|-
| [[relay|Relay]] || 0x8E
|-
| [[motor]] || 0x90
|-
| [[User Interface]] || 0x94
|-
| [[7_Segment]]|| 0x96
|-
<!--
| [[SPI_SPI]] || 0x98
|-
-->
| [[pushbutton]] || 0x9A
|-
| [[bigrelay]] || 0x9C
|-
| [[Dimmer]] || 0x9E
<!--
| thermo || 0xa0
|-
| ... || 0xA2
|-
-->
|-
| [[Raspberry Juice]] || 0xA4
|-
| [[rpi spi relay]] || 0xA6
|}
336eac51363c297b52e0f153fbd3e4206a9f3dea
Raspberry Relay
0
1708
3016
2934
2014-12-19T14:37:44Z
Sjoerd
2544
/* Datasheets */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. It can be found in the shop [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay here].
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
e229efb3660ca83bb317a4b1ca07a8d83acaf0cd
3017
3016
2014-12-19T14:38:31Z
Sjoerd
2544
/* Datasheets */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. It can be found in the shop [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay here].
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
313e8292794a4bc8ee93a2f265947d7d54581748
3018
3017
2014-12-19T14:39:52Z
Sjoerd
2544
/* Overview */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. It can be found in the shop [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay here].
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
07c49d07c0a33648ee87abcbc5cde9b40cc26278
3019
3018
2014-12-19T14:49:35Z
Sjoerd
2544
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-spi-relay Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-solid-state-relay Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
af5faf51298e77bddaa598934b111140c368d0d2
3020
3019
2014-12-19T14:50:47Z
Sjoerd
2544
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi/RPi-solid-state-relay Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi/RPi-solid-state-relay Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
a6f3d8cbd1731d693d870e25abbadaff0d6b2651
3021
3020
2014-12-19T14:52:33Z
Sjoerd
2544
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
15d6f98d62039e578e315b8463295c70af398606
3022
3021
2015-01-06T20:36:47Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or sending us an Email: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
8ef3bed130712b663607e9caa61d069967a79a54
3023
3022
2015-01-06T20:41:16Z
Rew
3
/* Usage */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or sending us an Email: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
77f6ba7416216ebde29ab5e8ed82e44f9807d5d5
3024
3023
2015-01-06T20:42:29Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or sending us an Email: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf]
d9af66889cc49566f241ed28b49dd7c6fa9bda14
3025
3024
2015-01-06T20:42:58Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or sending us an Email: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
3fae7e431c9da875959a4c8dbf99aa6b0d28e9db
3026
3025
2015-01-06T20:43:34Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or sending us an Email: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
4476fd6f3e1c558c17d17fccd36ad31ad6da66fe
Rtc
0
1652
3027
2672
2015-01-09T09:13:08Z
Rew
3
wikitext
text/x-wiki
First, the i2c-bcm2708 i2c driver needs to be loaded. As far as I know, in the first few months of the raspberry pi being available, the module was blacklisted and didn't load automatically, but nowadays the module is loaded by default. If it isn't on your system:
sudo modprobe i2c-bcm2708
Load the I2C and RTC drivers as root:
sudo -s
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.d/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
hwclock -s
Source: http://www.element14.com/community/message/63885
e4fac2f632f0ad1a8168ca22ef98a56537ab7bb8
3028
3027
2015-01-11T09:31:50Z
Rew
3
wikitext
text/x-wiki
First, the i2c-bcm2708 i2c driver needs to be loaded. As far as I know, in the first few months of the raspberry pi being available, the module was blacklisted and didn't load automatically. Nowadays "raspi-config" will already give you the option to enable the driver.
What "raspi-config" does (but you can also do by hand) is remove the drivers from /etc/modprobe.d/raspi-blacklist.conf .
If the driver isn't loaded on your system start with:
sudo modprobe i2c-bcm2708
Then load the I2C and RTC drivers as root:
sudo -s
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.d/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
hwclock -s
Source: http://www.element14.com/community/message/63885
8831bca206d95930ab11fdc864ce11689d3d9a4f
FTDI serial
0
19
3029
527
2015-01-12T14:22:05Z
Rew
3
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
857946fdcf63a4662298529f46a1038edea7f6ef
3030
3029
2015-01-12T14:29:24Z
Rew
3
/* pinout */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td><td>works at 5V or 3.3V level depening on jumper</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
af64f5cb296ddf772ae8cb8fc8d71e0f91d2976c
3031
3030
2015-01-12T14:30:47Z
Rew
3
/* pinout */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 3 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td><td>do not drive at 5V level if jumper is set to 3.3v.<br>
probably works if driven at 3.3V with jumper at 5V.</td></tr>
<tr><td>3</td><td>Tx (T)</td><td>works at 5V or 3.3V level depening on jumper</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to CBUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
3ac8c509aa1243b2b15b0049546207cac2b72449
3032
3031
2015-01-12T14:30:55Z
Rew
3
/* pinout */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 3-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td><td>do not drive at 5V level if jumper is set to 3.3v.<br>
probably works if driven at 3.3V with jumper at 5V.</td></tr>
<tr><td>3</td><td>Tx (T)</td><td>works at 5V or 3.3V level depening on jumper</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to CBUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
07d089776fcf4e8cb93c5b12ba403dbc186843a9
3033
3032
2015-01-12T14:32:09Z
Rew
3
/* overview */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
For references to left-right, and top-bottom in this page, please hold the board with the USB connector on the left and the serial connector on the right.
== External resources ==
== pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td><td>do not drive at 5V level if jumper is set to 3.3v.<br>
probably works if driven at 3.3V with jumper at 5V.</td></tr>
<tr><td>3</td><td>Tx (T)</td><td>works at 5V or 3.3V level depening on jumper</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to CBUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper near C2)<br>
2-3: 5V (jumper near the edge of the board<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
cbe7eafbc5f4af49f027df9da4e591800fe36a22
3034
3033
2015-01-12T14:36:31Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
For references to left-right, and top-bottom in this page, please hold the board with the USB connector on the left and the serial connector on the right.
== External resources ==
== pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td><td>do not drive at 5V level if jumper is set to 3.3v.<br>
probably works if driven at 3.3V with jumper at 5V.</td></tr>
<tr><td>3</td><td>Tx (T)</td><td>works at 5V or 3.3V level depening on jumper</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to CBUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper on the side nearest the chip and USB connector)<br>
2-3: 5V (jumper near the serial connector)<br>
<br>
This switches the "VCCIO" pin on the FT232RL chip, as well as the "V+" pin on the serial connector.
At the 3.3V setting you're allowed to draw up to 50mA from this pin.
At the 5V setting, you can use whatever the USB bus allows. Officially that would probably be 100mA, as the FTDI chip, by default, doesn't ask for more. However, in practise you can very often get away with drawing as much as 500mA (even without asking). You can program the chip to ask for more by programming the eeprom of the chip using an FTDI programming utility.
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
087857ed8cb634a9ed09307624aaed0cd23e70fb
3035
3034
2015-01-12T14:37:25Z
Rew
3
/* future hardware enhancements */
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== overview ==
The FTDI-serial board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
For references to left-right, and top-bottom in this page, please hold the board with the USB connector on the left and the serial connector on the right.
== External resources ==
== pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td><td>do not drive at 5V level if jumper is set to 3.3v.<br>
probably works if driven at 3.3V with jumper at 5V.</td></tr>
<tr><td>3</td><td>Tx (T)</td><td>works at 5V or 3.3V level depening on jumper</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to CBUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper on the side nearest the chip and USB connector)<br>
2-3: 5V (jumper near the serial connector)<br>
<br>
This switches the "VCCIO" pin on the FT232RL chip, as well as the "V+" pin on the serial connector.
At the 3.3V setting you're allowed to draw up to 50mA from this pin.
At the 5V setting, you can use whatever the USB bus allows. Officially that would probably be 100mA, as the FTDI chip, by default, doesn't ask for more. However, in practise you can very often get away with drawing as much as 500mA (even without asking). You can program the chip to ask for more by programming the eeprom of the chip using an FTDI programming utility.
== future hardware enhancements ==
Allow "hacker" access to more IOs on the FTDI chip with "test pads" on the bottom of the PCB.
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
984c5358985501abdeda03af8a663508cdd62259
FT312D
0
1723
3036
2980
2015-01-12T14:41:22Z
Rew
3
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board. (FT 312 D to help people like me find it with the search function).
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
ee12fe6c4ea3b54b46725c754f8f46613eea03de
Firmware upgrade STM32Wifi
0
1750
3037
2015-01-19T09:27:30Z
Rew
3
Created page with "This upgrade procedure currently requires Linux. I'm sure ST has a tool for windows, but I haven't come across it. If you know the procedure under windows, let me know, or exp..."
wikitext
text/x-wiki
This upgrade procedure currently requires Linux. I'm sure ST has a tool for windows, but I haven't come across it. If you know the procedure under windows, let me know, or expand this page.
== tools required ==
* A Linux PC.
* dfu-util installed.
* Optionally: A config file.
=== Installing dfu-util ===
dfu-util is part of the Ubuntu distribution:
apt-get install dfu-util
should do the job for users of recent ubuntu distributions.
Otherwise, cloning the git repository and compiling that should work:
git clone https://gitorious.org/dfu-util/dfu-util.git
cd dfu-util
./autogen.sh
./configure
make
make install
(I did this a while ago, this was typed from memory. If you do it, let me know if it works).
== performing the upgrade ==
You need a binary. It's currently called chwifi.bin.
Put the device in DFU firmware upgrade mode: Move the jumper to the position towards the crystal. Then insert the USB cable. The device should enumerate as an STM-DFU device: "Product: STM32 BOOTLOADER".
Then issue:
dfu-util -a 0 -d 0483:df11 -s 0x8000000 -D chwifi.bin
If you want to configure your stm32wifi over a ttl-level serial port, then you're done: move the jumper back and reboot the device (powercycle or hit the reset button).
Otherwise you need to generate a config file:
create the script makeconfigbin:
#!/bin/sh
if [ $# -ne 4 ] ; then
echo usage $0 ssid password host url
exit 1
fi
#makechar 255 255 255 255
makeconfigstring 32 "$1"
makeconfigstring 32 "$2"
makeconfigstring 64 "$3"
makeconfigstring 64 "$4"
and makeconfigstring:
#!/bin/sh
len=$1
str=$2
tmp=`tempfile`
#for i in `seq $len` ; do
# makechar 255 >> $tmp
#done
dd if=/dev/zero bs=$len count=1 | tr '\0' '\377' > $tmp
(echo -n $str ; dd if=/dev/zero bs=1 count=1 ) | dd of=$tmp conv=notrunc
cat $tmp
rm $tmp
Now you can run the makeconfigbin script and provide it with your wifi credentials and the server host and URL:
./makeconfigbin <wifissid> <wifipassword> www.bitwizard.nl /esp/logit.php\? > config.bin
Put in your own wifi ssid and password. Then:
dfu-util -a 0 -d 0483:df11 -s 0x801fc00 -D config.bin
will flash it into permanent storage of the stm32wifi.
Note that if you change the wifi credentials, the device will continue to attempt to use the old wifi. Only when that fails will it switch to the new credentials.
182c0cdebeab5426f801b083a85680049cfee307
3038
3037
2015-01-19T09:29:20Z
Rew
3
/* performing the upgrade */
wikitext
text/x-wiki
This upgrade procedure currently requires Linux. I'm sure ST has a tool for windows, but I haven't come across it. If you know the procedure under windows, let me know, or expand this page.
== tools required ==
* A Linux PC.
* dfu-util installed.
* Optionally: A config file.
=== Installing dfu-util ===
dfu-util is part of the Ubuntu distribution:
apt-get install dfu-util
should do the job for users of recent ubuntu distributions.
Otherwise, cloning the git repository and compiling that should work:
git clone https://gitorious.org/dfu-util/dfu-util.git
cd dfu-util
./autogen.sh
./configure
make
make install
(I did this a while ago, this was typed from memory. If you do it, let me know if it works).
== performing the upgrade ==
You need a binary. It's currently called chwifi.bin.
Put the device in DFU firmware upgrade mode: Move the jumper to the position towards the crystal. Then insert the USB cable. The device should enumerate as an STM-DFU device: "Product: STM32 BOOTLOADER".
Then issue:
dfu-util -a 0 -d 0483:df11 -s 0x8000000 -D chwifi.bin
If you want to configure your stm32wifi over a ttl-level serial port, then you're done: move the jumper back and reboot the device (powercycle or hit the reset button).
Otherwise you need to generate a config file:
create the script makeconfigbin:
#!/bin/sh
if [ $# -ne 4 ] ; then
echo usage $0 ssid password host url
exit 1
fi
#makechar 255 255 255 255
makeconfigstring 32 "$1"
makeconfigstring 32 "$2"
makeconfigstring 64 "$3"
makeconfigstring 64 "$4"
and makeconfigstring:
#!/bin/sh
len=$1
str=$2
tmp=`tempfile`
#for i in `seq $len` ; do
# makechar 255 >> $tmp
#done
dd if=/dev/zero bs=$len count=1 | tr '\0' '\377' > $tmp
(echo -n $str ; dd if=/dev/zero bs=1 count=1 ) | dd of=$tmp conv=notrunc
cat $tmp
rm $tmp
Now you can run the makeconfigbin script and provide it with your wifi credentials and the server host and URL:
./makeconfigbin <wifissid> <wifipassword> www.bitwizard.nl /esp/logit.php\? > config.bin
Put in your own wifi ssid and password. Then:
dfu-util -a 0 -d 0483:df11 -s 0x801fc00 -D config.bin
will flash it into permanent storage of the stm32wifi. Now you can move the jumper back and restart the device.
Note that if you change the wifi credentials, the device will continue to attempt to use the old wifi. Only when that fails will it switch to the new credentials.
== future ==
In the future the device will support USB so using dfu-util to flash the config will no longer be necessary.
88bb1bd6eb942a1db42fa7410a9103aabacc6452
3FETs
0
483
3039
2708
2015-02-02T16:05:17Z
Rew
3
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
0e0ed8e6ec9d6e428ce4f93d5be5c91d4dd35080
Stmwifi
0
1751
3040
2015-02-02T16:33:23Z
Rew
3
Created page with " This is the documentation page for the STMWIFI board. == Overview == The board has a connector for an ESP8266 WIFI module, an USB port and a bunch of IO connectors. == A..."
wikitext
text/x-wiki
This is the documentation page for the STMWIFI board.
== Overview ==
The board has a connector for an ESP8266 WIFI module, an USB port and a bunch of IO connectors.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The FET outputs on the "ODO" pins are capable of sinking about 1A per output. We have tested 1A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A max we specify.
=== Possible Configurations ===
We recommend powering the board through an USB connector.
Currently the firmware does not yet support enumerating as an USB device. This should become available in the future.
The "console" of the device is currently on the connector called "UART". Connect a TTL-level usb-serial device there. The baud rate is 115200.
The J2-J6 connectors provide an easy way to connect three-pin-sensors. For example DHT11, DHT22, or DS18S20. Future firmware may support using the connectors as a servo output. The pinout is prepared for servos: 1-GND, 2-VCC, 3-signal. The signal pins are connected to PA4, PA5, PA7, PA8, PB1 respectively.
the SV3 connector provides 16 GPIO pins. These are connected to GPIOC.
The ODO (I don't remember what that stands for) connector provides VCC (5V or 3.3V), GND and 4 open drain outputs. You could drive a 5-pin stepper with this, or a led strip. There is no flyback diode, so if you're driving inductive loads, you should provide one yourself.
The chip has two I2C modules that are brought out to an I2C connector. You might be able to use these as GPIO or more sensors too. No real firmware support for I2C yet.
The SPI bus is brought out to the SPI connector. The pinout is the same as for AVR ICSP connectors (and documented elsewhere on this wiki). The firmware currently initializes the SPI module, and allows sending text to the BitWizard SPI LCD modules.
== External resources ==
=== Datasheets ===
* The STM32F072 datasheet: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00090510.pdf
* The STM32F0x2 reference manual: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/DM00031936.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
3cafda002343fb2e0f495d0e7a706fb51304e92c
File:RGB clock back complete edit.jpg
6
1752
3041
2015-02-06T11:13:40Z
Rew
3
The "big picture" but with a few locations marked.
wikitext
text/x-wiki
The "big picture" but with a few locations marked.
92e2c36bbe82cda10d0028e4508348d18fbba907
DIO protocol
0
432
3043
2874
2015-02-11T10:28:01Z
Rew
3
/* Read Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. Tho following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
bb1ef446e042e52d43bf3d3d7a43b489b872a83d
User Interface
0
1505
3044
2904
2015-02-14T10:19:51Z
Rew
3
/* Using the RTC */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -w 16:0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -w 17:0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -w 17:32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
aafbc35f5da00d7dbb5e5b80117d2198d9111b1a
File:FT4222h.jpg
6
1755
3048
2015-03-09T16:23:58Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
FT4222h
0
1756
3049
2015-03-09T16:37:28Z
Sjoerd
2544
Created page with "[[File:FT4222h.jpg|thumb|300px]] This is the documentation page for the FT4222h breakout board. == overview == The FT4222h breakout board has an USB connector, two SPI con..."
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board.
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
<TODO>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The only jumper Is for selecting the I/O voltage. 1-2 = 1V8, 2-3 = 3V3.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
aaba2925616cab2a6e0bc5053bd690eb2811eb8a
3050
3049
2015-03-09T16:47:00Z
Sjoerd
2544
/* Jumper settings */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board.
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
<TODO>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
<TODO>
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
24ec5e24e459ee8b1d8fa381c291249581c71131
3051
3050
2015-03-10T08:45:15Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board.
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
<TODO>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors. This is a solder jumper. We default the jumper to 5V with a small trace on the PCB.
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
872d7805fd7f9a66e9898de95a90090c844023df
3053
3051
2015-03-10T08:50:46Z
Rew
3
/* pinout */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board.
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
<TODO>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors. This is a solder jumper. We default the jumper to 5V with a small trace on the PCB.
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
2f0e3e9d0eaef6bb0c5b53aef0f2a9b8ebcfe388
SPI connector pinout
0
87
3052
2467
2015-03-10T08:50:11Z
Rew
3
/* Connecting the BitWizard boards to an Arduino */
wikitext
text/x-wiki
For the interconnect between the SPI masters and the SPI expansion boards BitWizard uses a 6-pin SPI cable.
The pinout is the same (or very similar) to the pinout of the 6-pin ICSP programming connector that lots of AVR boards have.
{| border=1
! pin !! function !! remark
|-
| 1 || MISO || Master In Slave Out
|-
| 2 || VCC || power
|-
| 3 || SCK || Shift Clock
|-
| 4 || MOSI || Master Out Slave In.
|-
| 5 || SS || Slave Select
|-
| 6 || GND || Ground 0V
|-
|}
The connector is laid out as follows:
{| border=1
|-
| 1 || 2
|-
| 3 || 4
|-
| 5 || 6
|-
|}
The board usually has pin 1 and six marked.
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin
|-
| 1 || MISO || 12
|-
| 2 || VCC || 5V
|-
| 3 || SCK || 13
|-
| 4 || MOSI || 11
|-
| 5 || SS || 10
|-
| 6 || GND || Gnd
|-
|}
You could use other pins, but then you have to make a software SPI implementation. This is not too difficult, but might be neccesary if something else is already on the SPI pins. On the other hand, you might be able to still use the hardware SPI module by just moving the "SS" pin somewhere else.
Arduino tells me that with differing chips being used as the "heart" of the module, the SPI pins are always available on the connector marked "ISP". The pin 5 or slave select is connected to the reset line, so it is not available to drive external slave select.
On BitWizard Raspduino and ftdiatmega boards you can chose if that connector becomes SPI out or ISP.
== Connecting the BitWizard boards to a Raspberry pi ==
{| border=1
! pin !! function !! Raspberry pi P1 pin
|-
| 1 || MISO || 21 GPIO 9
|-
| 2 || VCC || 2,4 5V
|-
| 3 || SCK || 23 GPIO 11
|-
| 4 || MOSI || 19 GPIO 10
|-
| 5 || SS || 24 CE0 or 26 CE1
|-
| 6 || GND || 6, 9, 14,20,25 Gnd
|-
|}
You could use other pins, but then you have to make a software SPI implementation. This is not too difficult, but might be neccesary if something else is already on the SPI pins.
afce92de70c723f10980b40cdc84f5c01251600b
Raspberry Pi camera extension kit
0
1665
3054
2817
2015-03-16T16:08:16Z
Sjoerd
2544
wikitext
text/x-wiki
[[File:Rpicamextstraight.jpg|thumb|300px|Camera extension kit with straight pins]]
[[File:Rpicamextangle.jpg|thumb|300px|Camera extension kit with angled pins]]
== Overview ==
This kit allows you to expand the length of the Raspberry Pi camera by converting the standard FFC cable to a generic 2.54mm pin set. You could use the attached connectors to create a ribbon cable, let us create the ribbon cable, or use your own cable. Please note that the ribbon cable has an angled connector. The kit can be found in the shop [http://www.bitwizard.nl/catalog/product_info.php?products_id=146 here]
== Connecting ==
You can recognise this version by the way the connectors one the "camera board" converter are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard is on the pin16 side of the board)<br>
<br>
== Splitting cable ==
For more flexability, it is possible to split the cable into individual wires. Keep in mind that you have to keep the following wires fused together:
Pin 2&3
Pin 4&5
Pin 7&8
Pin 10&11
Pin 14&15
63c13ff31408cfc96ff989e36c26b5bef8ab5327
3055
3054
2015-03-16T16:08:37Z
Sjoerd
2544
/* Splitting cable */
wikitext
text/x-wiki
[[File:Rpicamextstraight.jpg|thumb|300px|Camera extension kit with straight pins]]
[[File:Rpicamextangle.jpg|thumb|300px|Camera extension kit with angled pins]]
== Overview ==
This kit allows you to expand the length of the Raspberry Pi camera by converting the standard FFC cable to a generic 2.54mm pin set. You could use the attached connectors to create a ribbon cable, let us create the ribbon cable, or use your own cable. Please note that the ribbon cable has an angled connector. The kit can be found in the shop [http://www.bitwizard.nl/catalog/product_info.php?products_id=146 here]
== Connecting ==
You can recognise this version by the way the connectors one the "camera board" converter are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard is on the pin16 side of the board)<br>
<br>
== Splitting cable ==
For more flexability, it is possible to split the cable into individual wires. Keep in mind that you have to keep the following wires fused together:<br>
Pin 2&3<br>
Pin 4&5<br>
Pin 7&8<br>
Pin 10&11<br>
Pin 14&15
8e345f8b2fe0c5447ee27270f0ef2f8e8b82cb8e
USB Relay
0
1678
3056
2772
2015-03-23T18:01:52Z
Rew
3
/* Additional software */
wikitext
text/x-wiki
== intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound. This has not been converted to a BAT file for windows yet.
For Windows users, there is an INF file in the zipfile. Tell windows that this is the driver for your device, and it will use the builtin driver to create a virtual comport. The "usbr.bat" script assumes this has become "COM3", but it could be a higher number. If so, you can adjust the script and change the default to whatever your comport has become, or use an environment variable. IIRC, you can add something like "set relayport=COM5" to your c:\autoexec.bat . It has been a long time since I worked with Windows. Please let me know if this works.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyACMx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
6d6fd08dbfd521310e05a7bde62ceba987d7f109
BitWizard Wiki:About
4
1758
3058
2015-05-23T08:39:50Z
Rew
3
Created page with "This wiki documents the bitwizard expansion boards. This wiki is publicly editable if you pass the captcha and create an account. You are not allowed to place links/advert..."
wikitext
text/x-wiki
This wiki documents the bitwizard expansion boards.
This wiki is publicly editable if you pass the captcha and create an account.
You are not allowed to place links/advertize unrelated sites here. Those will be removed.
If you find an error or think something can be clarified, you have the option to fix it yourself. The change will be reviewed by BitWizard on short notice.
Or you can send us an Email. It helps a lot if you can cut-paste the URL of the page you found the problem.
3731dc2e3520d90eb53f8cec88b623862e2e7c7d
BitWizard Wiki:General disclaimer
4
1759
3059
2015-05-23T08:41:33Z
Rew
3
Created page with "This wiki is publicly editable. We try to review all edits on short notice, but we cannot guarantee that edits by others are accurate. In fact, we can't even guarantee that in..."
wikitext
text/x-wiki
This wiki is publicly editable. We try to review all edits on short notice, but we cannot guarantee that edits by others are accurate. In fact, we can't even guarantee that information we placed here ourselves is 100% accurate. Please tell us about mistakes, typos and problems. We'll do our best to fix them.
4e3252eb7ac3d277887bb95f0c1b5cd325bf16f2
Field-upgrade bitwizard boards
0
1651
3060
2781
2015-05-26T10:08:09Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -U lfuse:w:0xe2:m hfuse:w:0xdf:m
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
edfdd5ffa2394264c8d473175aeb3adc0da06262
3061
3060
2015-05-26T10:08:39Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:r:ee.hex:i
avrdude -P gpio -b 1200 -u -c gpio -p atmega328 -U lfuse:w:0xe2:m hfuse:w:0xdf:m
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
ac27f9558313638eddc3ff661515be7720146279
3062
3061
2015-05-26T10:09:06Z
Rew
3
wikitext
text/x-wiki
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -b 1200 -U lfuse:w:0xe2:m hfuse:w:0xdf:m
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
5b2ed9e155b31a389fd56210ea8e8b05781e1102
Raspberry Juice
0
1699
3063
2899
2015-06-02T13:59:38Z
Rew
3
/* Use */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Use =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
== examples ==
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
0fea93ec1fa38d4b40f2d12c95aa97e8abc9e042
3064
3063
2015-06-02T15:41:16Z
Rew
3
/* examples */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Use =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
== usage ==
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== user input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
=== software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
== examples ==
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
cd007b779777fd1023043b0903154631d7f351f1
3065
3064
2015-06-02T15:41:42Z
Rew
3
/* Use */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Protocol definitions =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
== usage ==
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== user input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
=== software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
== examples ==
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
8ffbdba6cea69084fcef7bd846a76f24a5841e93
3066
3065
2015-06-02T15:42:07Z
Rew
3
/* Protocol definitions */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Protocol definitions =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
= usage =
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== user input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
=== software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
= examples =
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
953d55e624644f2384303e47eb8c65985a414972
3067
3066
2015-06-02T15:44:15Z
Rew
3
/* user input */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Protocol definitions =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
= usage =
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== user input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
When the 'pi is off, the 'juice will go into a power-saving mode. It will only test the button a few times per second. In this situation it is possible to press-and-release the button between two checks by the 'juice. To prevent this, you need a slightly longer press.
=== software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
= examples =
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
d57a07dbe0472046237867b7700cbf95e6b01567
Temperature Interface
0
51
3068
2927
2015-06-02T15:50:56Z
Rew
3
/* Future hardware enhancements */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Default operation ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
744b709fea9aad8ad20996acfacae4130111a5c1
3069
3068
2015-06-02T15:51:09Z
Rew
3
/* Default operation */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
4f07ab76e51b707ef3c35a60fadf8d54e64f36f9
3070
3069
2015-06-02T15:51:42Z
Rew
3
/* accuracy */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== examples ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
972958666c6858316f91ce7e0634a3c45a88996e
3076
3070
2015-06-03T13:47:43Z
Rew
3
/* examples */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== examples ==
The folowing script
#!/bin/sh
# Sample script to read and calculate a temperature.
#
if [ x"$1" = x"--init" ] ; then
# First initialize the temperature sensor.
# Channel 0 is first sensor, ... channel 3 is last sensor, sample four channels,
# add 64 (0x40) samples, and then... don't shift
bw_tool -I -D /dev/i2c-1 -a 8c -W 70:81:b 71:80:b 72:82:b 73:83:b 80:4:b 81:40:b 82:0:b
# wait for the settings to apply and enough sampes to be taken.
sleep 1
fi
adcconversion=`bw_tool -1 -I -D /dev/i2c-1 -a 8c -R 68:s`
# This value is scaled to 65535 is 1.1V.
# So:
# (1) voltage = adcconversion * 1.1 / 65535
# For the MCP9700 temperature sensor:
# (2) voltage = 0.5V + temp * 0.010V/C
# Some reworking results in:
# (3) temp = (voltage - 0.5)/0.01
# Now we can substitute the voltage from (1) and get:
# (4) temp = 100 * (adcconversion * 1.1 / 65535 - 0.5)
# and reworking this we get:
# (5) temp = .001678 * adcconversion - 50
temp=`echo $adcconversion \* .001678 - 50 | bc -l`
echo "temperature is: $temp"
will initialize all four channels if you pass it --init and then read out just the first. On the adcconversion= ... line you need to change to 69 for the second sensor, 6a for the third and 6b for the last.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
fe71ddc6dd869c016806f4d55c0f00f61b28bed8
3077
3076
2015-06-03T13:53:37Z
Rew
3
/* examples */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== examples ==
The folowing script
#!/bin/sh
# Sample script to read and calculate a temperature.
#
# for I2C:
TEMPBRD="bw_tool -I -D /dev/i2c-1 -a 8c"
# for SPI:
#TEMPBRD="bw_tool -a 8c"
#
if [ x"$1" = x"--init" ] ; then
# First initialize the temperature sensor.
# Channel 0 is first sensor, ... channel 3 is last sensor, sample four channels,
# add 64 (0x40) samples, and then... don't shift
$TEMPBRD -W 70:81:b 71:80:b 72:82:b 73:83:b 80:4:b 81:40:b 82:0:b
# wait for the settings to apply and enough sampes to be taken.
sleep 1
fi
adcconversion=`$TEMPBRD -1 -R 68:s`
# This value is scaled to 65535 is 1.1V.
# So:
# (1) voltage = adcconversion * 1.1 / 65535
# For the MCP9700 temperature sensor:
# (2) voltage = 0.5V + temp * 0.010V/C
# Some reworking results in:
# (3) temp = (voltage - 0.5)/0.01
# Now we can substitute the voltage from (1) and get:
# (4) temp = 100 * (adcconversion * 1.1 / 65535 - 0.5)
# and reworking this we get:
# (5) temp = .001678 * adcconversion - 50
temp=`echo $adcconversion \* .001678 - 50 | bc -l`
echo "temperature is: $temp"
will initialize all four channels if you pass it --init and then read out just the first. On the adcconversion= ... line you need to change to 69 for the second sensor, 6a for the third and 6b for the last.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
73c6b5d83045183dda890f47f4cf37ab049cc888
DIO protocol
0
432
3071
3043
2015-06-02T16:18:00Z
Rew
3
/* Setting up the ADC */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
48f3cdfe9d27c2dc7476f6775e08f39ea51b97ad
3080
3071
2015-07-15T04:58:55Z
Rew
3
/* Example */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
== PWM Example ===
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
e516e934eb69fef6f62e251a5c0005606578233d
3081
3080
2015-07-15T04:59:52Z
Rew
3
/* ADC Example */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ===
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
69751bea82cf340bbccd8788c4cb50ab58d7b44e
3082
3081
2015-07-15T05:02:07Z
Rew
3
/* PWM Example = */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ===
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
e3a2dfacf1050258308f7894bef5f2acc2ee12ba
3099
3082
2015-08-25T14:15:21Z
Rew
3
/* PWM Example = */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
5ab915b114d5d05b1056373158e153a5bb62952b
3100
3099
2015-08-25T14:16:28Z
Rew
3
/* move stepper to step 0x1234 */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
#!/bin/sh
t=0.1
addr=4e
#addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
754f8b2052ef7c167fa1e5523203f6cbedc8b2d6
3101
3100
2015-08-25T14:17:31Z
Rew
3
/* example script for rpi */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
a0b1bba806b64d124875475520c42c8a48443f8b
3102
3101
2015-08-25T14:19:01Z
Rew
3
/* example script for rpi */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down.
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
cb0f261d8c62585d7044d68611ef2e61c01ddeae
3103
3102
2015-08-25T14:19:42Z
Rew
3
/* example script for rpi */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
1e9ee5fe970197d9d7e761114e5dff719e39711e
3104
3103
2015-08-25T14:44:06Z
Rew
3
/* example script for rpi */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== example sketch for Arduino ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
f78aa9758d326290ccbd6851ebb373e8fa045e00
3105
3104
2015-08-26T13:49:38Z
Rew
3
/* example sketch for Arduino */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== example sketch for Arduino ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
8b20028cb7ab98b7dcbdf5c014d67b1e930cbaa6
3106
3105
2015-08-26T13:54:36Z
Rew
3
/* example sketch for Arduino */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== example sketch for Arduino ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 7
#define ADDR (0x84)
//#define DATAOUT 11 //MOSI
//#define DATAIN 12 //MISO
//#define SPICLOCK 13 //sck
#define SLAVESELECT 18 //ss
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
pinMode (LED, OUTPUT);
digitalWrite (LED, t&1);
delay(100);
}
452e2eeb7b00a12cfc8a52b7391c0299fbbdf94a
3107
3106
2015-08-26T15:08:01Z
Rew
3
/* example sketch for Arduino */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 7
#define ADDR (0x84)
//#define DATAOUT 11 //MOSI
//#define DATAIN 12 //MISO
//#define SPICLOCK 13 //sck
#define SLAVESELECT 18 //ss
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
pinMode (LED, OUTPUT);
digitalWrite (LED, t&1);
delay(100);
}
ebd5c546b2767d525a8a1b3f05c720de07f22e64
3108
3107
2015-08-26T15:08:11Z
Rew
3
/* Arduino example: SPI */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 7
#define ADDR (0x84)
//#define DATAOUT 11 //MOSI
//#define DATAIN 12 //MISO
//#define SPICLOCK 13 //sck
#define SLAVESELECT 18 //ss
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
pinMode (LED, OUTPUT);
digitalWrite (LED, t&1);
delay(100);
}
c009b8f2082e4f9d3ef888f515d36e58ad7d38bf
3109
3108
2015-08-26T15:10:27Z
Rew
3
/* Arduino example sketch: SPI */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, you still have to make the signals into outputs. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
6df1b51c3f73a90d34591d11f56c9067d9dbb8c3
File:Dsc05850 edit.jpg
6
1760
3072
2015-06-03T12:44:32Z
Rew
3
i2c_splitter with some pins labeled.
wikitext
text/x-wiki
i2c_splitter with some pins labeled.
03b0121bde9c6c3cf1d3b02825a589b5d99fd110
I2C splitter
0
1683
3073
2996
2015-06-03T12:54:03Z
Rew
3
/* pinouts */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
[[File:Dsc05850_edit.jpg|thumb|500px|alt=The annotated i2c_splitter board|The i2c_splitter board]]
The "Vout" connector provides GND/AUX/VCC. By placing a jumper on AUX/VCC, you can configure your slave I2C busses to use the same power supply as your main VCC (usually 5V or 3.3V). If you require a different voltage, you can apply that voltage using a two-pin connector using GND/AUX on the same connector. If you ordered the special version prepared for a specific output voltage, no connection/jumper is necessary on the VOUT connector. You can measure the output voltage on the AUX pin if you want (there are 8 other pins that make this voltage available, but it's there. :-) )
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
70e9adee4a4482ca58324a5714ace0c08c4252a0
3074
3073
2015-06-03T12:54:50Z
Rew
3
/* Power jumper/power connector */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
[[File:Dsc05850_edit.jpg|thumb|500px|alt=The annotated i2c_splitter board|The i2c_splitter board]]
The "Vout" connector provides GND/AUX/VCC. By placing a jumper on AUX/VCC, you can configure your slave I2C busses to use the same power supply as your main VCC (usually 5V or 3.3V). If you require a different voltage, you can apply that voltage using a two-pin connector using GND/AUX on the same connector. If you ordered the special version prepared for a specific output voltage, no connection/jumper is necessary on the VOUT connector. You can measure the output voltage on the AUX pin if you want (there are 8 other pins that make this voltage available, but it's there. :-) )
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
f720c1095148e37569aef1c7055a1131049a0ec4
3075
3074
2015-06-03T12:55:23Z
Rew
3
/* Power jumper/power connector */
wikitext
text/x-wiki
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
[[File:Dsc05850_edit.jpg|thumb|500px|alt=The annotated i2c_splitter board|The i2c_splitter board]]
The "Vout" connector provides GND/AUX/VCC. By placing a jumper on AUX/VCC, you can configure your slave I2C busses to use the same power supply as your main VCC (usually 5V or 3.3V). If you require a different voltage, you can apply that voltage using a two-pin connector using GND/AUX on the same connector. If you ordered the special version prepared for a specific output voltage, no connection/jumper is necessary on the VOUT connector. You can measure the output voltage on the AUX pin if you want (there are 8 other pins that make this voltage available, but it's there. :-) )
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your master is 5V and your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
bd1abf77d96937439ef7cf82b4bbbb9d36b4c05f
Raspberry Juice
0
1699
3078
3067
2015-06-03T14:41:49Z
Rew
3
/* halting the 'pi */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Protocol definitions =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
= usage =
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== user input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
When the 'pi is off, the 'juice will go into a power-saving mode. It will only test the button a few times per second. In this situation it is possible to press-and-release the button between two checks by the 'juice. To prevent this, you need a slightly longer press.
=== software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
Or you could write a 0 to register 0x33. That would immediately turn off the power.
=== Setting powerup-defaults ===
The module has to know what to do when IT first receives power. So you can write to registers 0x38 through 0x3b to set the default values that get loaded into the variables at 0x30-0x33 at powerup. The values you set are stored in eeprom and will be used on the next boot.
=== sensitivity to inputs ===
The board can listen to the button on the board, as well as the external input. You could, for example, tell the board not to listen to the button while the 'pi is running. Then just before shutting down you enable the button again, and tell the 'juice to cut the power.
There is also an external input. You could connect an external switch, or drive it from some other source. Either the UP or the DOWN transition is considered an activation. You can set which one with the polarity variable.
= examples =
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
55e3f6ae8120e1251b90bf1c450bd87e0173d0dd
3120
3078
2015-09-03T13:02:13Z
Rew
3
/* examples */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Protocol definitions =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
= usage =
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== user input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
When the 'pi is off, the 'juice will go into a power-saving mode. It will only test the button a few times per second. In this situation it is possible to press-and-release the button between two checks by the 'juice. To prevent this, you need a slightly longer press.
=== software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
Or you could write a 0 to register 0x33. That would immediately turn off the power.
=== Setting powerup-defaults ===
The module has to know what to do when IT first receives power. So you can write to registers 0x38 through 0x3b to set the default values that get loaded into the variables at 0x30-0x33 at powerup. The values you set are stored in eeprom and will be used on the next boot.
=== sensitivity to inputs ===
The board can listen to the button on the board, as well as the external input. You could, for example, tell the board not to listen to the button while the 'pi is running. Then just before shutting down you enable the button again, and tell the 'juice to cut the power.
There is also an external input. You could connect an external switch, or drive it from some other source. Either the UP or the DOWN transition is considered an activation. You can set which one with the polarity variable.
= examples =
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
Explanation of the command:
* -I and -D /dev/i2c-1 specify that the module is the I2C version. If you use SPI0, you can leave these off. When you use SPI1, you would specify -D /dev/spidev0.1
* -a a4 specifies the address of the module on the bus. 0xa4 is the 'juice address. You could change this, but this is usually not necessary (it does not make sense to have more than one of these modules).
* -W specifies that you want to write to an address.
* 21:2710:i is the register, 21, the value 0x2710 = 10000, and the datatype i=32-bit-integer.
* 20:3e8:i is the register, 20, the value 0x3e8 = 1000, and the datatype i=32-bit-integer.
ee4f59d7015e9c71527ee8be28add0d2ad7675e0
Stm32wifi
0
1762
3083
2015-07-15T15:42:43Z
Rew
3
Created page with " == Overview == This board is meant to log sensor information over a WIFI link to a server with a database. It can also perform as an actuator, i.e. drive signals. == conn..."
wikitext
text/x-wiki
== Overview ==
This board is meant to log sensor information over a WIFI link to a server with a database. It can also perform as an actuator, i.e. drive signals.
== connectors ==
For sensors or actuators 5 three-pin connectors are provided. Each has the pinout GND, 5V, signal. Compatible sensors include DHT11, DHT22 and DS18B20. Compatible actuators are servos (software implementation TODO).
For sensors or actuators, a 6 pin SPI connector is available.
For configuration and debugging a 4-pin UART connection is available.
For sensors (and TODO: actuators?) two 4 pin I2C connectors are provided. Each has the pinout GND, SDA, SCL, 5V. Compatible sensors are currently MS5637 pressure sensors, but many other sensors are possible in future software updates.
For medium current applications, 4 open drain outputs are available. Max voltage: 20V. Max current: 1A/output. This is provided on a (2x3) 6-pin header. Pinout is GND, 5V, out0, out1, out2, out3.
For expansion IO a (2x10) 20 pin header is provided. Pinout is GND, GND, IO0, IO1, ... IO15, 5V, 5V.
== jumpers ==
There is a three pin jumper J7. With 1-2 connected the board is in "normal operation" (Open often works as well, not recommended). With 2-3 connected the board is in bootloader mode. It will accept new firmware over USB in this mode. See [[Firmware upgrade STM32Wifi]]
There is a solder jumper that allows you to switch the 5V on most of the IO connectors to 3V3. Outputs will always be 3.3V levels, many inputs (but not all) are 5V tolerant. (TODO: check which ones).
== leds ==
There is one power led near the SPI connector.
There are two programmable leds near the open drain output connector. Currently the software blinks one led regularly, and the other blinks the software-state. State 9 (nine blinks) is "normal operations".
== Operation ==
Connect over the UART or (soon) over USB to the serial port of the board. Use 115200 baud. When the board boots you should see some information about the WIFI Module booting. When you hit enter you should get a prompt. Type "help" to see the list of commands and to double check that communication is working.
You can now enter the "wifi" command:
wifi <ssid> <wifipassword>
Put your own wifi credentials here, for example
wifi netgear4567 mypassword
Next issue the host command to enter the host and logging URL:
host <host> <logging url>
for example:
host www.bitwizard.nl /esp/logit.php?
Issue the uid command to get your module's unique id. You will need that to configure your device.
e709a56feb72c9e8d10bdd80b5c8f80a3eb6e3ad
3085
3083
2015-07-15T15:45:56Z
Rew
3
wikitext
text/x-wiki
[[File:STM32WIFI.jpg|thumb|300px|alt=The STM32WIFI board|The STM32WIFI board]]
== Overview ==
This board is meant to log sensor information over a WIFI link to a server with a database. It can also perform as an actuator, i.e. drive signals.
== connectors ==
For sensors or actuators 5 three-pin connectors are provided. Each has the pinout GND, 5V, signal. Compatible sensors include DHT11, DHT22 and DS18B20. Compatible actuators are servos (software implementation TODO).
For sensors or actuators, a 6 pin SPI connector is available.
For configuration and debugging a 4-pin UART connection is available.
For sensors (and TODO: actuators?) two 4 pin I2C connectors are provided. Each has the pinout GND, SDA, SCL, 5V. Compatible sensors are currently MS5637 pressure sensors, but many other sensors are possible in future software updates.
For medium current applications, 4 open drain outputs are available. Max voltage: 20V. Max current: 1A/output. This is provided on a (2x3) 6-pin header. Pinout is GND, 5V, out0, out1, out2, out3.
For expansion IO a (2x10) 20 pin header is provided. Pinout is GND, GND, IO0, IO1, ... IO15, 5V, 5V.
== jumpers ==
There is a three pin jumper J7. With 1-2 connected the board is in "normal operation" (Open often works as well, not recommended). With 2-3 connected the board is in bootloader mode. It will accept new firmware over USB in this mode. See [[Firmware upgrade STM32Wifi]]
There is a solder jumper that allows you to switch the 5V on most of the IO connectors to 3V3. Outputs will always be 3.3V levels, many inputs (but not all) are 5V tolerant. (TODO: check which ones).
== leds ==
There is one power led near the SPI connector.
There are two programmable leds near the open drain output connector. Currently the software blinks one led regularly, and the other blinks the software-state. State 9 (nine blinks) is "normal operations".
== Operation ==
Connect over the UART or (soon) over USB to the serial port of the board. Use 115200 baud. When the board boots you should see some information about the WIFI Module booting. When you hit enter you should get a prompt. Type "help" to see the list of commands and to double check that communication is working.
You can now enter the "wifi" command:
wifi <ssid> <wifipassword>
Put your own wifi credentials here, for example
wifi netgear4567 mypassword
Next issue the host command to enter the host and logging URL:
host <host> <logging url>
for example:
host www.bitwizard.nl /esp/logit.php?
Issue the uid command to get your module's unique id. You will need that to configure your device.
46e691f83fa233bf7585a7e005a8166ba1aebb40
File:STM32WIFI.jpg
6
1763
3084
2015-07-15T15:44:47Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Main Page
0
1
3093
2978
2015-08-11T11:12:44Z
Rew
3
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an email
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
878b91920241c63fb166b3635de0ca870cb2d641
I2C accellerometer
0
1768
3094
2015-08-11T11:35:08Z
Rew
3
Created page with "= general info = The I2C accellerometer is based on the MMA8652. = pinout = As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male ..."
wikitext
text/x-wiki
= general info =
The I2C accellerometer is based on the MMA8652.
= pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC.
== voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....)
= examples =
This is a sample script that runs on raspberry pi to extract the X, Y and Z accellerometer values. It requires you install the bw_tool.
#!/bin/sh
acc="bw_tool -I -D /dev/i2c-1 -a 3a"
# reset the accelerometer.
$acc -W 2b:40:b
# minimum 1ms IIRC.
sleep 0.01
#
#select range=1 for +/- 4G fs range.
#range=1
range=0
#
$acc -W 0e:"$range":b 2b:2:b 2c:0:b 2d:1:b 2e:1:b 2a:39:b
sleep 1
#$acc -R 0:l
result=`$acc -R 0:l |sed -e 's/\(..\)/\1 /g' `
#echo $result
x=`echo $result | awk '{print $7$6}'`
y=`echo $result | awk '{print $5$4}'`
z=`echo $result | awk '{print $3$2}'`
echo x=$x y=$y z=$z
The numbers are presented in hex. Remember that (in the default +/-2G fs range) 4000 is one G, c000 is about minus one G.
Mine currently reports:
x=0c70 y=0580 z=3f30
so it is not quite flat (X and Y significantly differ from zero. I get about +/- 60 when its pressed to the table). but it is still registering almost a full G in the Z direction .
= datasheets =
[[http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8652FC.pdf]]
8187c128c68c0b4ad4bccc7a2b279057e7d5bac1
3097
3094
2015-08-11T14:27:02Z
Rew
3
/* general info */
wikitext
text/x-wiki
= general info =
The I2C accellerometer is based on the MMA8652 from freescale.
= pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC.
== voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....)
= examples =
This is a sample script that runs on raspberry pi to extract the X, Y and Z accellerometer values. It requires you install the bw_tool.
#!/bin/sh
acc="bw_tool -I -D /dev/i2c-1 -a 3a"
# reset the accelerometer.
$acc -W 2b:40:b
# minimum 1ms IIRC.
sleep 0.01
#
#select range=1 for +/- 4G fs range.
#range=1
range=0
#
$acc -W 0e:"$range":b 2b:2:b 2c:0:b 2d:1:b 2e:1:b 2a:39:b
sleep 1
#$acc -R 0:l
result=`$acc -R 0:l |sed -e 's/\(..\)/\1 /g' `
#echo $result
x=`echo $result | awk '{print $7$6}'`
y=`echo $result | awk '{print $5$4}'`
z=`echo $result | awk '{print $3$2}'`
echo x=$x y=$y z=$z
The numbers are presented in hex. Remember that (in the default +/-2G fs range) 4000 is one G, c000 is about minus one G.
Mine currently reports:
x=0c70 y=0580 z=3f30
so it is not quite flat (X and Y significantly differ from zero. I get about +/- 60 when its pressed to the table). but it is still registering almost a full G in the Z direction .
= datasheets =
[[http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8652FC.pdf]]
ada39baf4e2687c79a2addc2f5a8605c692f6c04
I2C magnetometer
0
1769
3095
2015-08-11T11:56:50Z
Rew
3
Created page with "= general info = The I2C magnetometre is based on the MAG3110 from freescale. = pinout = As with all bitwizard I2C boards, the board has a 4 pin female connector on the lef..."
wikitext
text/x-wiki
= general info =
The I2C magnetometre is based on the MAG3110 from freescale.
= pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC.
== voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....)
= examples =
This is a sample script that runs on raspberry pi to extract the X, Y and Z accellerometer values. It requires you install the bw_tool.
#!/bin/sh
mag="bw_tool -I -D /dev/i2c-1 -a 1c"
$mag -W 10:2:b
sleep 0.1
result=`$mag -R 0:l |sed -e 's/\(..\)/\1 /g' `
#echo $result
x=`echo $result | awk '{print $7$6}'`
y=`echo $result | awk '{print $5$4}'`
z=`echo $result | awk '{print $3$2}'`
echo x=$x y=$y z=$z
The numbers are presented in hex. The magnetic field of the earth is in fact quite small. (your nails don't pop out of the wall if they align with the magnetic field do they?) So the measurement requires some calibration, but the values do change when you change the orientation of the device.
= datasheets =
[[http://cache.freescale.com/files/sensors/doc/data_sheet/MAG3110.pdf]]
dd7241f74d559b7cb9b79c7b8fda3ea75cf6a04c
3098
3095
2015-08-11T14:27:25Z
Rew
3
/* examples */
wikitext
text/x-wiki
= general info =
The I2C magnetometre is based on the MAG3110 from freescale.
= pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC.
== voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....)
= examples =
This is a sample script that runs on raspberry pi to extract the X, Y and Z magneto values. It requires you install the bw_tool.
#!/bin/sh
mag="bw_tool -I -D /dev/i2c-1 -a 1c"
$mag -W 10:2:b
sleep 0.1
result=`$mag -R 0:l |sed -e 's/\(..\)/\1 /g' `
#echo $result
x=`echo $result | awk '{print $7$6}'`
y=`echo $result | awk '{print $5$4}'`
z=`echo $result | awk '{print $3$2}'`
echo x=$x y=$y z=$z
The numbers are presented in hex. The magnetic field of the earth is in fact quite small. (your nails don't pop out of the wall if they align with the magnetic field do they?) So the measurement requires some calibration, but the values do change when you change the orientation of the device.
= datasheets =
[[http://cache.freescale.com/files/sensors/doc/data_sheet/MAG3110.pdf]]
b1801e6001bc9db645e65e38fabbde00a3fa413d
I2C pressure sensor
0
1770
3096
2015-08-11T14:26:11Z
Rew
3
Created page with "= general info = The I2C pressure sensor is based on the MS5637 from Measurement Specialties. = pinout = As with all bitwizard I2C boards, the board has a 4 pin female conn..."
wikitext
text/x-wiki
= general info =
The I2C pressure sensor is based on the MS5637 from Measurement Specialties.
= pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC. (with a bit of luck this is now silk-screened on the back of the board.)
== voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V nominal VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....). The chip can handle 4k7 pullups to 5V on the I2C bus.
= examples =
This is an example arduino sketch that prints the pressure every second.
#include <Wire.h>
#include <BaroSensor.h>
void setup()
{
Serial.begin(9600);
BaroSensor.begin();
}
void loop()
{
float temp, pres;
if(!BaroSensor.isOK()) {
Serial.print("Sensor not Found/OK. Error: ");
Serial.println(BaroSensor.getError());
BaroSensor.begin(); // Try to reinitialise the sensor if we can
} else {
temp = BaroSensor.getTemperature();
pres = BaroSensor.getPressure();
Serial.print (millis ());
Serial.print (" ");
// Serial.print("T: ");
Serial.print(temp);
// Serial.print(" P: ");
Serial.print (" ");
Serial.println(pres);
}
delay (1000);
}
= datasheets =
[[http://www.farnell.com/datasheets/1756129.pdf]]
a7dfa4a5f5c1cda10270f1ac4201afbde7406da4
3111
3096
2015-08-31T14:16:48Z
Sjoerd
2544
wikitext
text/x-wiki
= general info =
The I2C pressure sensor is based on the MS5637 from Measurement Specialties. It can be found on address 0xEC.
= pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC. (with a bit of luck this is now silk-screened on the back of the board.)
== voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V nominal VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....). The chip can handle 4k7 pullups to 5V on the I2C bus.
= examples =
This is an example arduino sketch that prints the pressure every second.
#include <Wire.h>
#include <BaroSensor.h>
void setup()
{
Serial.begin(9600);
BaroSensor.begin();
}
void loop()
{
float temp, pres;
if(!BaroSensor.isOK()) {
Serial.print("Sensor not Found/OK. Error: ");
Serial.println(BaroSensor.getError());
BaroSensor.begin(); // Try to reinitialise the sensor if we can
} else {
temp = BaroSensor.getTemperature();
pres = BaroSensor.getPressure();
Serial.print (millis ());
Serial.print (" ");
// Serial.print("T: ");
Serial.print(temp);
// Serial.print(" P: ");
Serial.print (" ");
Serial.println(pres);
}
delay (1000);
}
= datasheets =
[[http://www.farnell.com/datasheets/1756129.pdf]]
5b2c12b82a02b08ce279a3c296ab71198d7905d9
3112
3111
2015-08-31T14:19:38Z
Sjoerd
2544
/* general info */
wikitext
text/x-wiki
= general info =
The I2C pressure sensor is based on the MS5637 from Measurement Specialties. It can be found on address 0xEC (7 bit address: 0x76). More info about 7 bit and 8 bit address can be found on the following page: [[I2c_addresses]]
= pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC. (with a bit of luck this is now silk-screened on the back of the board.)
== voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V nominal VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....). The chip can handle 4k7 pullups to 5V on the I2C bus.
= examples =
This is an example arduino sketch that prints the pressure every second.
#include <Wire.h>
#include <BaroSensor.h>
void setup()
{
Serial.begin(9600);
BaroSensor.begin();
}
void loop()
{
float temp, pres;
if(!BaroSensor.isOK()) {
Serial.print("Sensor not Found/OK. Error: ");
Serial.println(BaroSensor.getError());
BaroSensor.begin(); // Try to reinitialise the sensor if we can
} else {
temp = BaroSensor.getTemperature();
pres = BaroSensor.getPressure();
Serial.print (millis ());
Serial.print (" ");
// Serial.print("T: ");
Serial.print(temp);
// Serial.print(" P: ");
Serial.print (" ");
Serial.println(pres);
}
delay (1000);
}
= datasheets =
[[http://www.farnell.com/datasheets/1756129.pdf]]
0b9db8a7a3a459c1caaa59b172a2736608239fc6
Dimmer
0
1695
3110
2824
2015-08-31T12:46:02Z
Rew
3
/* Control */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found in the shop
[http://www.bitwizard.nl/catalog/product_info.php?products_id=166 here]
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
76cacfe91290b7b0408d6112e6e4556b8b681d83
Raspberry Pi camera extension kit
0
1665
3113
3055
2015-09-02T09:41:41Z
Rew
3
/* Connecting */
wikitext
text/x-wiki
[[File:Rpicamextstraight.jpg|thumb|300px|Camera extension kit with straight pins]]
[[File:Rpicamextangle.jpg|thumb|300px|Camera extension kit with angled pins]]
== Overview ==
This kit allows you to expand the length of the Raspberry Pi camera by converting the standard FFC cable to a generic 2.54mm pin set. You could use the attached connectors to create a ribbon cable, let us create the ribbon cable, or use your own cable. Please note that the ribbon cable has an angled connector. The kit can be found in the shop [http://www.bitwizard.nl/catalog/product_info.php?products_id=146 here]
== Connecting ==
You can recognise this version by the way the connectors one the "camera board" converter are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard logo is on the pin16 side of the board)<br>
<br>
If you have trouble inserting the FPC into the connectors, please see: [[connecting FPCs]].
== Splitting cable ==
For more flexability, it is possible to split the cable into individual wires. Keep in mind that you have to keep the following wires fused together:<br>
Pin 2&3<br>
Pin 4&5<br>
Pin 7&8<br>
Pin 10&11<br>
Pin 14&15
752d717922051c4108de0cbf9d1d53be936cec69
Connecting FPCs
0
1771
3114
2015-09-02T09:42:44Z
Rew
3
Created page with "Connecting an FPC is easy. When you get the camera kit, it will look like this:"
wikitext
text/x-wiki
Connecting an FPC is easy.
When you get the camera kit, it will look like this:
94f588f57c028e4a5a53fd3531864d15901ae6e2
3119
3114
2015-09-02T09:58:15Z
Rew
3
wikitext
text/x-wiki
Connecting an FPC is easy.
When you get the camera kit, it will look like this:
[[File:Dsc05937_small.jpg|400px|FPC connector as delivered.]]
First open up the FPC connector. Use your fingernails or a ballpoint pen (with the ballpoint retracted) to push the (in this case light brown) retention-clip outward:
[[File:Dsc05938_small.jpg|400px|FPC connector opened up.]]
Then insert the FPC into the connector.
[[File:Dsc05939_small.jpg|400px|FPC inserted into the connector.]]
Note that the connectors may have a small notch protruding from the clip. This prevents the FPC from lying perfectly flat, but does not influence the functioning of the system. If you are bothered by this, you could, at your own risk, remove the notch with a sharp knife.
Then close the clip:
[[File:Dsc05940_small.jpg|400px|FPC connector closed.]]
Done!
6e9b571ab39aeec7a53cc861092d750a06e1f9e8
File:Dsc05937 small.jpg
6
1772
3115
2015-09-02T09:43:23Z
Rew
3
FPC connector as delivered.
wikitext
text/x-wiki
FPC connector as delivered.
e9302ae6da18cacc4520fddf4d83056667325a10
File:Dsc05938 small.jpg
6
1773
3116
2015-09-02T09:43:42Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:Dsc05939 small.jpg
6
1774
3117
2015-09-02T09:44:51Z
Rew
3
FPC connector with FPC inserted.
wikitext
text/x-wiki
FPC connector with FPC inserted.
45bfd02610bb82a36b188dcaa6a776a04a045910
File:Dsc05940 small.jpg
6
1775
3118
2015-09-02T09:45:14Z
Rew
3
FPC connector closed with FPC inserted.
wikitext
text/x-wiki
FPC connector closed with FPC inserted.
48e03ea962ccd4b64f6066ac142c2979bac2a82f
Bw tool
0
1635
3121
2901
2015-09-03T15:17:16Z
Rew
3
/* Installation/Compiling */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
1f099f8b1b0e97215b7de8e832c0e9d3a735545c
3122
3121
2015-09-03T15:19:01Z
Rew
3
/* Basic Example */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
For example, if you have an I2C module, add:
-I -D /dev/i2c-1
to switch to i2c-mode and specify the correct device.
If you have a rpi_ui plugged onto your raspberry pi, add:
-a 94
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched. While on rev. 1 Pi's
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
33ccdbb7d022dd91092b979f08e6357b281c1c8d
3123
3122
2015-09-03T15:21:59Z
Rew
3
/* Options Specifying the Device */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
For example, if you have an I2C module, add:
-I -D /dev/i2c-1
to switch to i2c-mode and specify the correct device.
If you have a rpi_ui plugged onto your raspberry pi, add:
-a 94
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched, so you need -D /dev/i2c-1, while on the first raspberry pi's -D /dev/i2c-0 is redundant as that is the default.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
6552a8721e383cab49aaa13e991050ccab039003
User Interface
0
1505
3124
3044
2015-09-04T10:36:04Z
Cartridge1987
2553
/* bash script to show system informations */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
#clean the display
bw_tool -I -a 94 -w 10:0
while true; do
#get cpu loads
load=`top -bn1 | grep load | cut -d' ' -f13-`
#print the current time
bw_tool -I -a 94 -w 17:0
bw_tool -I -a 94 -t `date +%H:%M:%S`
#print the load averages
bw_tool -I -a 94 -w 17:32
bw_tool -I -a 94 -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
c72693a31632caf2f2ca378d2d55b80975cae6a3
3125
3124
2015-09-04T11:16:41Z
Rew
3
/* bash script to show system informations */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`tcut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
64dc891aa827aa9e96b645eab31b34d8bea32b3b
User Interface
0
1505
3126
3125
2015-09-04T11:16:56Z
Rew
3
/* bash script to show system informations */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`tcut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
2481150040be6d96dfe0cc40da996d4cf389f09e
3127
3126
2015-09-04T11:19:23Z
Rew
3
/* bash script to show system informations */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just issue:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
fa1c53cc0f3cc877e78e808483e4832a978783ea
3130
3127
2015-09-07T12:54:13Z
Cartridge1987
2553
/* I2C */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board.
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just use:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
0752b0f84eb9c64d15d9940bf7d2aa78c375160b
Main Page
0
1
3128
3093
2015-09-04T13:09:16Z
Cartridge1987
2553
/* Help! */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* use the search function on the left
* send us an [http://www.bitwizard.nl/contact.php email]
* or use the forum: http://forum.bitwizard.nl/
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
3847020c212499aa8c906284e4a621c698bf8f27
3129
3128
2015-09-04T13:22:06Z
Cartridge1987
2553
/* Help! */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact] us
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
3dc02140a99274d1f860bb7d7752155866ddae7d
Temperature sensor example
0
1571
3131
2784
2015-09-07T13:48:38Z
Cartridge1987
2553
/* initialization */
wikitext
text/x-wiki
== initialization ==
The following is a script that I use to initialize the temperature sensors for the rpi_ui board.
#!/bin/sh
ui="bw_tool -a 94"
#ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -w 70:c7 # internal tempsens with internal 1.1V as reference
$ui -w 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -w 82:6
$ui -w 80:2
The above script is written for the SPI version of the board. The commented out like is for the i2c-version. So activate that line if you have the i2c version (remove the comment marker).
== readout ==
The following is a script that shows the temperature on stdout. I call this script "showtemp".
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -s 100000 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
== display ==
The following clears the screen and then shows the temperature.
bw_tool -a 94 -w 10:0
bw_tool -a 94 -t "temp: "`./showtemp`
bfff585ab910bc468b9a01eee1a4faa878bf23d1
Raspberry Relay
0
1708
3132
3026
2015-09-10T11:43:13Z
Cartridge1987
2553
/* Pinout */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php Contact] us: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
e9ba23778ffd79956baa86bf9aefd285c7376037
3133
3132
2015-09-10T11:45:34Z
Cartridge1987
2553
/* Pinout */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php contact] us: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
47a84a221a1dd2d4971d02d5bca205fa50c87ae6
File:HelloDave.png
6
1776
3134
2015-09-11T08:05:56Z
Cartridge1987
2553
the text: Hello Dave printed on a RPi_UI board. ( Raspberry Pi Display )
( Hello Dave is a reference to 2001:A Space Odyssey. What is a movie from Stanley Kubrick. )
blacklight is turned on.
wikitext
text/x-wiki
the text: Hello Dave printed on a RPi_UI board. ( Raspberry Pi Display )
( Hello Dave is a reference to 2001:A Space Odyssey. What is a movie from Stanley Kubrick. )
blacklight is turned on.
8c8211dbdbe22ad45f274d7a3750b4389a1a91b1
File:HelloDaveDark.png
6
1777
3135
2015-09-11T08:33:07Z
Cartridge1987
2553
'Hello Dave' printed on a RPi_UI board =, with the back light on it lowest level.
'Hello Dave' is a reference to the famous movie called: '2001: A Space odyssey' from Stanley Kubrick.
wikitext
text/x-wiki
'Hello Dave' printed on a RPi_UI board =, with the back light on it lowest level.
'Hello Dave' is a reference to the famous movie called: '2001: A Space odyssey' from Stanley Kubrick.
c7e7551b1d93a20c5b96629ad6b40823145527e8
File:94.png
6
1778
3136
2015-09-11T08:53:59Z
Cartridge1987
2553
I2c_RPI_UI 1.6A
A: 94
wikitext
text/x-wiki
I2c_RPI_UI 1.6A
A: 94
4207c90d06463ec993eb32036547cbe6d26af0fb
File:RaspberryPiClock.png
6
1779
3137
2015-09-11T08:57:58Z
Cartridge1987
2553
In this image the RPi_UI board(Raspberry Pi interface) is used as a clock.
wikitext
text/x-wiki
In this image the RPi_UI board(Raspberry Pi interface) is used as a clock.
0143f995aef5dbfe3e1e56450c7a4f4233027143
File:Temperature.png
6
1780
3138
2015-09-11T09:00:40Z
Cartridge1987
2553
In this image the RPi_UI board(Raspberry Pi Interface) is used to show the temperature of it's environment.
wikitext
text/x-wiki
In this image the RPi_UI board(Raspberry Pi Interface) is used to show the temperature of it's environment.
8386bfa6ea82d8a6ce2d76a6986f41c4d8986ad8
File:DSC05993TSE.png
6
1781
3139
2015-09-11T09:02:40Z
Cartridge1987
2553
In this image RPi_UI board(Raspberry Pi Interface) is used to show the time and the temperature of it's environment.
wikitext
text/x-wiki
In this image RPi_UI board(Raspberry Pi Interface) is used to show the time and the temperature of it's environment.
f8fa9de9f1b1361dd071a6b7c93f3ef02fcfc393
File:Wiz.png
6
1782
3140
2015-09-11T09:04:41Z
Cartridge1987
2553
On the RPi_UI board(Raspberry Pi Interface) the buttons are used to type: 'Wiz'
button 1 = W
Button 2 = i
button 3 = z
wikitext
text/x-wiki
On the RPi_UI board(Raspberry Pi Interface) the buttons are used to type: 'Wiz'
button 1 = W
Button 2 = i
button 3 = z
579da6de31b3f4b04ac449b16a2996c9e41b6c75
File:Wizard.png
6
1783
3141
2015-09-11T09:07:56Z
Cartridge1987
2553
The RPi_UI board(Raspberry pi interface )buttons were in this image used to type: 'Wizard'
button 1 = W
Button 2 = i
Button 3 = z
button 4 = a
button 5 = r
button 6 = d
wikitext
text/x-wiki
The RPi_UI board(Raspberry pi interface )buttons were in this image used to type: 'Wizard'
button 1 = W
Button 2 = i
Button 3 = z
button 4 = a
button 5 = r
button 6 = d
93287610af3e78c30e615b4eb5645b347e6ee22b
Blog 01
0
1784
3142
2015-09-11T09:30:50Z
Cartridge1987
2553
In this text Harry explains how he got his Raspberry Pi ready to be used.
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this blog I will keep you posted about my Raspberry Pi progress.
The first thing I want to happen is to get the Raspberry pi to work.
For this I had to download the software:
Raspbian
https://www.raspberrypi.org/downloads/raspbian/
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the Raspberry site.
(https://www.raspberrypi.org/documentation/installation/installing-images/ ) I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code: df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
When the green led is blinking it means, that there are no problems with the Raspberry Pi.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the pi with the ip-address.
You can find your ip-address with typing in the terminal:
sudo ifconfig
Your Ip-adress will be visible after:
inet addr:
So at my was visible:
inet addr:192.168.234.66
It then asks about the Password. That is: Raspberry ( That is the password of every Raspberry Pi, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
d69d7691956403dad6c10bc296d883f3a93e46ed
3143
3142
2015-09-11T09:38:10Z
Cartridge1987
2553
links click able and overall more overview
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this blog I will keep you posted about my Raspberry Pi progress.
The first thing I want to happen is to get the Raspberry pi to work.
For this I had to download the software:
[https://www.raspberrypi.org/downloads/raspbian/ Raspbian ]
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry site.] I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code:
df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
When the green led is blinking it means, that there are no problems with the Raspberry Pi.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the pi with the ip-address.
You can find your ip-address with typing in the terminal:
sudo ifconfig
Your Ip-adress will be visible after:
inet addr:
So at my was visible:
inet addr:192.168.234.66
It then asks about the Password. That is: Raspberry ( That is the password of every Raspberry Pi, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
ad7f1c00d7536c96c1abc2c09741719c5e201567
3155
3143
2015-09-11T11:07:12Z
Rew
3
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this blog I will keep you posted about my Raspberry Pi progress.
The first thing I want to happen is to get the Raspberry pi to work.
For this I had to download the software:
[https://www.raspberrypi.org/downloads/raspbian/ Raspbian ]
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry site.] I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code:
df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
When the green led is blinking it means, that there are no problems with the Raspberry Pi.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the PI using it's IP address. For the IP address, consult your system administrator. Or sometimes your router's status page.
You can find your OWN ip-address on linux by typing in the terminal:
sudo ifconfig
Your IP-adress will be visible after:
inet addr:
So on my PI was visible:
inet addr:192.168.234.66
(but you can't do that until you have a connection. On the other hand, you can do that if you (temporarily) have a monitor and keyboard connected)
It then asks about the Password. That is: "raspberry" ( That is the password of the pi user on every raspbian install, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
6ec421dea777387b0c6b474117bdde362d8b8486
3167
3155
2015-09-11T14:49:00Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this [[Blog list]] I will keep you posted about my Raspberry Pi projects.
The first thing I want to happen is to get the Raspberry Pi to work.
For this I had to download the software:
[https://www.raspberrypi.org/downloads/raspbian/ Raspbian ]
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry site.] I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code:
df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
When the green led is blinking it means, that there are no problems with the Raspberry Pi.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the PI using it's IP address. For the IP address, consult your system administrator. Or sometimes your router's status page.
You can find your own ip-address on linux by typing in the terminal:
sudo ifconfig
Your IP-adress will be visible after:
inet addr:
So on my PI was visible:
inet addr:192.168.234.66
(but you can't do that until you have a connection. On the other hand, you can do that if you (temporarily) have a monitor and keyboard connected)
It then asks about the Password. That is: "raspberry" ( That is the password of the pi user on every Raspbian install, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
8a275018e2de32533f682d8214a8b0c4e73738bb
Blog 02
0
1785
3144
2015-09-11T09:43:42Z
Cartridge1987
2553
In this text Harry explains how to turn on and off a lamp with raspberry relays.
wikitext
text/x-wiki
Hello,
This is my first project with the Raspberry Pi. In this project I want to turn on and off a lamp with a Raspberry Relay. After I figured this out, I want to do more useful things with the Raspberry Relay and the lamp.
Before I connect the cables I want to know, where I have to put what were.
Or in other words where in the pin-outs do I have to put the cables from the power supply and the lamp itself.
On the wikipedia page from the Relay I found out that the power supply has to be on pin 9 and 10.
On pin 10 has to come the (+)blue cable and on pin 9 the (-)brown cable.
To find out where the (+)blue cable and (-)brown cable has to go at the relay. I first checked the relay with a multimeter with give the result same as on the site, that the left side is off and the right side is the relay activated. To know what is left and what is right: On the right side there is a small circle.
With this result I know that pin 1( or 3, 5 and 7) is where the (+)blue cable has to be putt in and other pin 2( or 4, 6, 8 ) I have to put the (-)brown cable.
*For getting the (+) and (-) cable I have to cut the cables and remove the rubber shell.
*Check if the cables are really well stuck in the pin-outs. ( By pulling the cables. )
Before putting the RaspBerry Relay on the Raspberry Pi:
I want to protect the bottom protrusions, with 2 times tape on them so that they don't get trough it.
The main reason I do this is because the Raspberry Relay will get 230 volt on it if it will get in contact with the Raspberry Pi, this could give fatal results.
Now I got all the cables connected I want to be sure my power supply is turned off. ( So that I don't get a shock of 230 volt! ) Now I can put it on my Raspberry Pi.
When the Raspberry Relay is on the Raspberry Pi you can see a green led on that shows that it is getting power.
Now everything is physical ready ( except the power supply ) we can start the programming.
First I had to download WiringPi, that sees the pins.
Sudo apt-get install git-core
To get the application to download WiringPi.
git clone git://git.drogon.net/wiringPi
To then download WiringPi with the application.
When downloaded I wanted to know if I had all files and all the updates.
cd wiringPi/
git pull origin
To make it work type:
./build
First we have to make all the relay outputs. We do that with the code:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
To check if the all the relays work we have to activate them all separate. So every code line has to get it's own turn.
gpio write 0 1
gpio write 1 1
gpio write 2 1
gpio write 3 1
At every line of the code you will hear a loud click sound. All the relays for me worked except the third one. The reason the third relay didn't work was because there was not led + mosfet soldered.
After that I knew which relays worked and didn't. I turned them all off:
gpio write 0 0
gpio write 1 0
gpio write 2 0
gpio write 3 0
When all the relays were off, I could finally turn on the power supply:
gpio write 0 1
and ta da! I burned my eyes!
The End
702c74eacec8e444f833bf5c33668efb10532300
3150
3144
2015-09-11T10:21:41Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
This is my first project with the Raspberry Pi. In this project I want to turn on and off a lamp with a Raspberry Relay. After I figured this out, I want to do more useful things with the Raspberry Relay and the lamp.
Before I connect the cables I want to know, where I have to put what were.
Or in other words where in the pin-outs do I have to put the cables from the power supply and the lamp itself.
[[File:Powerconnect.jpg|400px|thumb|right|]]
On the wikipedia page from the Relay I found out that the power supply has to be on pin 9 and 10.
On pin 10 has to come the (+)blue cable and on pin 9 the (-)brown cable.
[[File:Dsc05969_small_smallTSE.jpg|400px|thumb|right|]]
To find out where the (+)blue cable and (-)brown cable has to go at the relay. I first checked the relay with a multimeter with give the result same as on the site, that the left side is off and the right side is the relay activated. To know what is left and what is right: On the right side there is a small circle.
With this result I know that pin 1( or 3, 5 and 7) is where the (+)blue cable has to be putt in and other pin 2( or 4, 6, 8 ) I have to put the (-)brown cable.
*For getting the (+) and (-) cable I have to cut the cables and remove the rubber shell.
*Check if the cables are really well stuck in the pin-outs. ( By pulling the cables. )
[[File:Tapeonrelay.jpg|400px|thumb|right|]]
Before putting the RaspBerry Relay on the Raspberry Pi:
I want to protect the bottom protrusions, with 2 times tape on them so that they don't get trough it.
The main reason I do this is because the Raspberry Relay will get 230 volt on it if it will get in contact with the Raspberry Pi, this could give fatal results.
Now I got all the cables connected I want to be sure my power supply is turned off. ( So that I don't get a shock of 230 volt! ) Now I can put it on my Raspberry Pi.
When the Raspberry Relay is on the Raspberry Pi you can see a green led on that shows that it is getting power.
Now everything is physical ready ( except the power supply ) we can start the programming.
First I had to download WiringPi, that sees the pins.
Sudo apt-get install git-core
To get the application to download WiringPi.
git clone git://git.drogon.net/wiringPi
To then download WiringPi with the application.
When downloaded I wanted to know if I had all files and all the updates.
cd wiringPi/
git pull origin
To make it work type:
./build
First we have to make all the relay outputs. We do that with the code:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
To check if the all the relays work we have to activate them all separate. So every code line has to get it's own turn.
gpio write 0 1
gpio write 1 1
gpio write 2 1
gpio write 3 1
At every line of the code you will hear a loud click sound. All the relays for me worked except the third one. The reason the third relay didn't work was because there was not led + mosfet soldered.
After that I knew which relays worked and didn't. I turned them all off:
gpio write 0 0
gpio write 1 0
gpio write 2 0
gpio write 3 0
When all the relays were off, I could finally turn on the power supply:
gpio write 0 1
and ta da! I burned my eyes!
The End
4ddb052704c23501105e76ee4a426704b225f24d
3151
3150
2015-09-11T10:23:48Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
This is my first project with the Raspberry Pi. In this project I want to turn on and off a lamp with a Raspberry Relay. After I figured this out, I want to do more useful things with the Raspberry Relay and the lamp.
Before I connect the cables I want to know, where I have to put what were.
Or in other words where in the pin-outs do I have to put the cables from the power supply and the lamp itself.
[[File:Powerconnect.jpg|400px|thumb|right|]]
On the wikipedia page from the Relay I found out that the power supply has to be on pin 9 and 10.
On pin 10 has to come the (+)blue cable and on pin 9 the (-)brown cable.
[[File:Dsc05969_small_smallTSE.jpg|400px|thumb|right|]]
To find out where the (+)blue cable and (-)brown cable has to go at the relay. I first checked the relay with a multimeter with give the result same as on the site, that the left side is off and the right side is the relay activated. To know what is left and what is right: On the right side there is a small circle.
With this result I know that pin 1( or 3, 5 and 7) is where the (+)blue cable has to be putt in and other pin 2( or 4, 6, 8 ) I have to put the (-)brown cable.
*For getting the (+) and (-) cable I have to cut the cables and remove the rubber shell.
*Check if the cables are really well stuck in the pin-outs. ( By pulling the cables. )
[[File:Tapeonrelay.jpg|400px|thumb|right|]]
Before putting the RaspBerry Relay on the Raspberry Pi:
I want to protect the bottom protrusions, with 2 times tape on them so that they don't get trough it.
The main reason I do this is because the Raspberry Relay will get 230 volt on it if it will get in contact with the Raspberry Pi, this could give fatal results.
Now I got all the cables connected I want to be sure my power supply is turned off. ( So that I don't get a shock of 230 volt! ) Now I can put it on my Raspberry Pi.
When the Raspberry Relay is on the Raspberry Pi you can see a green led on that shows that it is getting power.
Now everything is physical ready ( except the power supply ) we can start the programming.
First I had to download WiringPi, that sees the pins.
Sudo apt-get install git-core
To get the application to download WiringPi.
git clone git://git.drogon.net/wiringPi
To then download WiringPi with the application.
When downloaded I wanted to know if I had all files and all the updates.
cd wiringPi/
git pull origin
To make it work type:
./build
First we have to make all the relay outputs. We do that with the code:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
To check if the all the relays work we have to activate them all separate. So every code line has to get it's own turn.
gpio write 0 1
gpio write 1 1
gpio write 2 1
gpio write 3 1
[[File:ConnectionLampOn.jpg|400px|thumb|right|]]
At every line of the code you will hear a loud click sound. All the relays for me worked except the third one. The reason the third relay didn't work was because there was not led + mosfet soldered.
After that I knew which relays worked and didn't. I turned them all off:
gpio write 0 0
gpio write 1 0
gpio write 2 0
gpio write 3 0
When all the relays were off, I could finally turn on the power supply:
gpio write 0 1
and ta da! I burned my eyes!
The End
22d30ac0d0cb70f83fe6379ffc12049a01681fa3
3163
3151
2015-09-11T13:04:04Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
This is my first project with the Raspberry Pi. In this project I want to turn on and off a lamp with a Raspberry Relay. After I figured this out, I want to do more useful things with the Raspberry Relay and the lamp.
Before I connect the cables I want to know, where I have to put what were.
Or in other words where in the pin-outs do I have to put the cables from the power supply and the lamp itself.
On the wikipedia page from the Relay I found out that the power supply has to be on pin 9 and 10.
On pin 10 has to come the (+)blue cable and on pin 9 the (-)brown cable.
[[File:Powerconnect.jpg|400px|thumb|none|]]
To find out where the (+)blue cable and (-)brown cable has to go at the relay. I first checked the relay with a multimeter with give the result same as on the site, that the left side is off and the right side is the relay activated. To know what is left and what is right: On the right side there is a small circle.
With this result I know that pin 1( or 3, 5 and 7) is where the (+)blue cable has to be putt in and other pin 2( or 4, 6, 8 ) I have to put the (-)brown cable.
[[File:Dsc05969_small_smallTSE.jpg|400px|thumb|none|]]
*For getting the (+) and (-) cable I have to cut the cables and remove the rubber shell.
*Check if the cables are really well stuck in the pin-outs. ( By pulling the cables. )
Before putting the Raspberry Relay on the Raspberry Pi:
I want to protect the bottom protrusions, with 2 times tape on them so that they don't get trough it.
The main reason I do this is because the Raspberry Relay will get 230 volt on it if it will get in contact with the Raspberry Pi, this could give fatal results.
[[File:Tapeonrelay.jpg|400px|thumb|none|]]
Now I got all the cables connected I want to be sure my power supply is turned off. ( So that I don't get a shock of 230 volt! ) Now I can put it on my Raspberry Pi.
When the Raspberry Relay is on the Raspberry Pi you can see a green led on that shows that it is getting power.
Now everything is physical ready ( except the power supply ) we can start the programming.
First I had to download WiringPi, that sees the pins.
Sudo apt-get install git-core
To get the application to download WiringPi.
git clone git://git.drogon.net/wiringPi
To then download WiringPi with the application.
When downloaded I wanted to know if I had all files and all the updates.
cd wiringPi/
git pull origin
To make it work type:
./build
First we have to make all the relay outputs. We do that with the code:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
To check if the all the relays work we have to activate them all separate. So every code line has to get it's own turn.
gpio write 0 1
gpio write 1 1
gpio write 2 1
gpio write 3 1
At every line of the code you will hear a loud click sound. All the relays for me worked except the third one. The reason the third relay didn't work was because there was not led + mosfet soldered.
After that I knew which relays worked and didn't. I turned them all off:
gpio write 0 0
gpio write 1 0
gpio write 2 0
gpio write 3 0
When all the relays were off, I could finally turn on the power supply:
gpio write 0 1
and ta da! I burned my eyes!
[[File:ConnectionLampOn.jpg|400px|thumb|none|]]
The End
2309e516741314fb772a3526ec4f9b0a95204049
3168
3163
2015-09-11T14:50:44Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
This is my first project with the Raspberry Pi. In this [[Blog list]] I will keep you posted about my Raspberry Pi projects.
In this project I want to turn on and off a lamp with a Raspberry Relay. After I figured this out, I want to do more useful things with the Raspberry Relay and the lamp.
Before I connect the cables I want to know, where I have to put what were.
Or in other words where in the pin-outs do I have to put the cables from the power supply and the lamp itself.
On the wikipedia page from the Relay I found out that the power supply has to be on pin 9 and 10.
On pin 10 has to come the (+)blue cable and on pin 9 the (-)brown cable.
[[File:Powerconnect.jpg|400px|thumb|none|]]
To find out where the (+)blue cable and (-)brown cable has to go at the relay. I first checked the relay with a multimeter with give the result same as on the site, that the left side is off and the right side is the relay activated. To know what is left and what is right: On the right side there is a small circle.
With this result I know that pin 1( or 3, 5 and 7) is where the (+)blue cable has to be putt in and other pin 2( or 4, 6, 8 ) I have to put the (-)brown cable.
[[File:Dsc05969_small_smallTSE.jpg|400px|thumb|none|]]
*For getting the (+) and (-) cable I have to cut the cables and remove the rubber shell.
*Check if the cables are really well stuck in the pin-outs. ( By pulling the cables. )
Before putting the Raspberry Relay on the Raspberry Pi:
I want to protect the bottom protrusions, with 2 times tape on them so that they don't get trough it.
The main reason I do this is because the Raspberry Relay will get 230 volt on it if it will get in contact with the Raspberry Pi, this could give fatal results.
[[File:Tapeonrelay.jpg|400px|thumb|none|]]
Now I got all the cables connected I want to be sure my power supply is turned off. ( So that I don't get a shock of 230 volt! ) Now I can put it on my Raspberry Pi.
When the Raspberry Relay is on the Raspberry Pi you can see a green led on that shows that it is getting power.
Now everything is physical ready ( except the power supply ) we can start the programming.
First I had to download WiringPi, that sees the pins.
Sudo apt-get install git-core
To get the application to download WiringPi.
git clone git://git.drogon.net/wiringPi
To then download WiringPi with the application.
When downloaded I wanted to know if I had all files and all the updates.
cd wiringPi/
git pull origin
To make it work type:
./build
First we have to make all the relay outputs. We do that with the code:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
To check if the all the relays work we have to activate them all separate. So every code line has to get it's own turn.
gpio write 0 1
gpio write 1 1
gpio write 2 1
gpio write 3 1
At every line of the code you will hear a loud click sound. All the relays for me worked except the third one. The reason the third relay didn't work was because there was not led + mosfet soldered.
After that I knew which relays worked and didn't. I turned them all off:
gpio write 0 0
gpio write 1 0
gpio write 2 0
gpio write 3 0
When all the relays were off, I could finally turn on the power supply:
gpio write 0 1
and ta da! I burned my eyes!
[[File:ConnectionLampOn.jpg|400px|thumb|none|]]
The End
51d8d756bf7a4b47f67c76237af695a72880a4b9
File:DSC05964.JPG
6
1786
3145
2015-09-11T09:45:43Z
Cartridge1987
2553
In this images my eyes got burned, because the amount of light of the lamp.
wikitext
text/x-wiki
In this images my eyes got burned, because the amount of light of the lamp.
6f6aa6b1673b93baa894591c1af56c4c22effc67
File:Dsc05969 small smallTSE.jpg
6
1787
3146
2015-09-11T09:55:16Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:ConnectionLampOn.jpg
6
1788
3147
2015-09-11T09:58:17Z
Cartridge1987
2553
In this image you see that the lamp is on, because of the Raspberry Relay pin being activated.
wikitext
text/x-wiki
In this image you see that the lamp is on, because of the Raspberry Relay pin being activated.
53aeeeee97a2d356da41a114b12488d50e9e4614
File:Tapeonrelay.jpg
6
1789
3148
2015-09-11T10:00:02Z
Cartridge1987
2553
In this image you see that the under part of the raspberry relay has 2 times a tape on it, so that it doesn't effect anything it is in contact with.
wikitext
text/x-wiki
In this image you see that the under part of the raspberry relay has 2 times a tape on it, so that it doesn't effect anything it is in contact with.
de3b80c24d7f17a76f0d2f2d50434aac2eed0cb1
File:Powerconnect.jpg
6
1790
3149
2015-09-11T10:02:32Z
Cartridge1987
2553
In this image you see that the power cables are connected with the raspberry relay in pin 10(+) and pin 9(-).
wikitext
text/x-wiki
In this image you see that the power cables are connected with the raspberry relay in pin 10(+) and pin 9(-).
5ee340c7517261f5184b6c2d7edfc27e32367b00
File:I2cdetect.jpg
6
1791
3152
2015-09-11T10:44:48Z
Cartridge1987
2553
show what you should get if the pi detect the i2c on 94.
wikitext
text/x-wiki
show what you should get if the pi detect the i2c on 94.
1422758c1ff6078674aa1230f1350d117d5994af
File:I2cdetecty.jpg
6
1792
3153
2015-09-11T10:53:19Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Blog 03
0
1793
3154
2015-09-11T10:58:46Z
Cartridge1987
2553
Created page with "Hello, I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience..."
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on screen.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
(after reboot)
Add it in the i2c the group
sudo gpasswd -a pi i2c
For adding user pi to group i2c
To look if it is added:
groups
Which will give as result
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it atleast has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo anymore.
This is handy because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|left|]]
To check if it works:
It will show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|left|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to:*
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave!'
To remove all the printed text from the screen use the code:
# bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
* also experienced that this all eventually didn't work on my display the raspberry was saying:
I2C_rpi_ui 1.6
A: 94
As you can see on the image
But if you don't have that and have that the raspberry is saying something like;
A: 1
you have to change this or always write to
a -1 to say Hello, Dave.
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
with i2cdetect you will also get this:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
But you can change the problem with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
and to remove and connect the display again.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now we can explore the things we can do with the Raspberry interface.
87e645f489c082624b1b68d5811b6f8fc8de6231
3156
3154
2015-09-11T11:12:22Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on screen.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
(after reboot)
Add it in the i2c the group
sudo gpasswd -a pi i2c
For adding user pi to group i2c
To look if it is added:
groups
Which will give as result
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it atleast has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo anymore.
This is handy because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|left|]]
To check if it works:
It will show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|left|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to:*
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|right|]]
To remove all the printed text from the screen use the code:
# bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|right|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
* also experienced that this all eventually didn't work on my display the raspberry was saying:
I2C_rpi_ui 1.6
A: 94
[[File:94.png|300px|thumb|right|]]
As you can see on the image
But if you don't have that and have that the raspberry is saying something like;
A: 1
you have to change this or always write to
a -1 to say Hello, Dave.
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
with i2cdetect you will also get this:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
But you can change the problem with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
and to remove and connect the display again.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now we can explore the things we can do with the Raspberry interface.
3e165bedb95936177976195684a8255a75973c8a
3164
3156
2015-09-11T13:09:11Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on screen.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
(after reboot)
Add it in the i2c the group
sudo gpasswd -a pi i2c
For adding user pi to group i2c
To look if it is added:
groups
Which will give as result
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it atleast has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo anymore.
This is handy because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|left|]]
To check if it works:
It will show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|left|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to:*
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
# bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
* also experienced that this all eventually didn't work on my display the raspberry was saying:
I2C_rpi_ui 1.6
A: 94
[[File:94.png|300px|thumb|none|]]
As you can see on the image
But if you don't have that and have that the raspberry is saying something like;
A: 1
you have to change this or always write to
a -1 to say Hello, Dave.
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
with i2cdetect you will also get this:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
But you can change the problem with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
and to remove and connect the display again.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now we can explore the things we can do with the Raspberry interface.
de0f467e83e6b6c80ecc4e5ec4b46ed13ad8658c
3165
3164
2015-09-11T13:18:04Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on screen.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
(after reboot)
Add it in the i2c the group
sudo gpasswd -a pi i2c
For adding user pi to group i2c
To look if it is added:
groups
Which will give as result
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it atleast has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo anymore.
This is handy because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|left|]]
To check if it works:
It will show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|left|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to:*
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
* also experienced that this all eventually didn't work on my display the raspberry was saying:
I2C_rpi_ui 1.6
A: 94
[[File:94.png|300px|thumb|none|]]
As you can see on the image
But if you don't have that and have that the raspberry is saying something like;
A: 1
you have to change this or always write to
a -1 to say Hello, Dave.
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
with i2cdetect you will also get this:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
But you can change the problem with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
and to remove and connect the display again.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now we can explore the things we can do with the Raspberry interface.
39918bb9c41d4637d4137268ff38b6f70f6d35b4
3169
3165
2015-09-11T14:54:19Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on screen.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
(after reboot)
Add it in the i2c the group
sudo gpasswd -a pi i2c
For adding user pi to group i2c
To look if it is added:
groups
Which will give as result
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it atleast has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo anymore.
This is handy because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|left|]]
To check if it works:
It will show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|left|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to:*
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
* also experienced that this all eventually didn't work on my display the raspberry was saying:
I2C_rpi_ui 1.6
A: 94
[[File:94.png|300px|thumb|none|]]
As you can see on the image
But if you don't have that and have that the raspberry is saying something like;
A: 1
you have to change this or always write to
a -1 to say Hello, Dave.
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
with i2cdetect you will also get this:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
But you can change the problem with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
and to remove and connect the display again.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now we can explore the things we can do with the Raspberry interface.
Go to [[Blog 04]], where I will print the time on the display.
61b5ddf5872a464db6015b2ade275b4e4e4e61a4
Blog 04
0
1794
3157
2015-09-11T11:40:06Z
Cartridge1987
2553
in this text harry explains how to get the raspberry user interface show how late it is.
wikitext
text/x-wiki
== !BETA! ==
Clock visible on machine:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
( Reference to which display to use
$DISPL -W 10:0:b
bytes
load
)
( use ctrl c to get out of the code ) ( ctrl z to let the code continue )
nano timer
sh timer
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sh mods.x^C
chmod +x timer
ls -l
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 timer
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
./timer
With my raspberry I sadly had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually:
to see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
Give the current date:
month-day-hours-minutes – year . seconds
( always add a zero before a number than is under 10! so 8 = 08 )
So 12:13:14 7 september 2015 becomes:
090712132015.14
date 090711002015.00
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
[[File:RaspberryPiClock.png|400px|thumb|left|]]
( when you turn it off and of by ctrl x and z it will also just come back to the right time. )
f442f107f89c91d3b8657669d74a4ce82a0fa8c1
3170
3157
2015-09-11T14:56:11Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Clock visible on machine:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
( Reference to which display to use
$DISPL -W 10:0:b
bytes
load
)
( use ctrl c to get out of the code ) ( ctrl z to let the code continue )
nano timer
sh timer
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sh mods.x^C
chmod +x timer
ls -l
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 timer
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
./timer
With my raspberry I sadly had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually:
to see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
Give the current date:
month-day-hours-minutes – year . seconds
( always add a zero before a number than is under 10! so 8 = 08 )
So 12:13:14 7 september 2015 becomes:
090712132015.14
date 090711002015.00
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
[[File:RaspberryPiClock.png|400px|thumb|left|]]
( when you turn it off and of by ctrl x and z it will also just come back to the right time. )
On [[Blog 05]] I will print the temperature on the display.
a15d0e2b5a5da896048e02fe1a9695a1e343cab4
Blog 05
0
1795
3158
2015-09-11T11:52:55Z
Cartridge1987
2553
Created page with " == !BETA! == Finally the temperature sensor: This will be a temperature sensor including the time. #!/bin/sh ui="bw_tool -a 94 -I -D /dev/i2c-1" $ui -W 70:c7 # inter..."
wikitext
text/x-wiki
== !BETA! ==
Finally the temperature sensor:
This will be a temperature sensor including the time.
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
chmod +x ui
ls -l ui
Which will give as result:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
./ui
#!/bin/sh
ui="bw_tool -I -D /dev/i2c-1 -a 94"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
bw_tool -a 94 -I -D /dev/i2c-1 ( also works fine )
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
apt-get install bc
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
0040
To edit the info
nano ui
Which has to change in to:
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
1000
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
The remove the latest one and see the newest you are doing it again
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
( links that I used: http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example )
( ui voor showtemp om werkende te krijgen time to wait )
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
nano friet
add this text:
( folder with a random name I called it friet. )
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
do like the other times:
chmod +x friet
[[File:Temperature.png|400px|thumb|left|]]
cff46abe12fac328e8dbf91a0c5422313fec40cb
3166
3158
2015-09-11T13:22:50Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Finally the temperature sensor:
This will be a temperature sensor including the time.
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
chmod +x ui
ls -l ui
Which will give as result:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
./ui
#!/bin/sh
ui="bw_tool -I -D /dev/i2c-1 -a 94"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
bw_tool -a 94 -I -D /dev/i2c-1 ( also works fine )
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
apt-get install bc
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
0040
To edit the info
nano ui
Which has to change in to:
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
1000
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
The remove the latest one and see the newest you are doing it again
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
Code that I used: http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example
( ui voor showtemp om werkende te krijgen time to wait )
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
nano friet
add this text:
( folder with a random name I called it friet. )
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
do like the other times:
chmod +x friet
[[File:Temperature.png|400px|thumb|left|]]
a82576e03e98b7d4392b52f11c56b986dc007e77
3171
3166
2015-09-11T14:57:46Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Finally the temperature sensor:
This will be a temperature sensor including the time.
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
chmod +x ui
ls -l ui
Which will give as result:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
./ui
#!/bin/sh
ui="bw_tool -I -D /dev/i2c-1 -a 94"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
bw_tool -a 94 -I -D /dev/i2c-1 ( also works fine )
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
apt-get install bc
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
0040
To edit the info
nano ui
Which has to change in to:
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
1000
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
The remove the latest one and see the newest you are doing it again
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
Code that I used: http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example
( ui voor showtemp om werkende te krijgen time to wait )
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
nano friet
add this text:
( folder with a random name I called it friet. )
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
do like the other times:
chmod +x friet
[[File:Temperature.png|400px|thumb|left|]]
On [[Blog 06]] I combined the temperature sensor and the time on the screen.
8a84713698086321bcc7482337728ac422b64964
3172
3171
2015-09-11T14:58:13Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Finally the temperature sensor:
This will be a temperature sensor including the time.
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
chmod +x ui
ls -l ui
Which will give as result:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
./ui
#!/bin/sh
ui="bw_tool -I -D /dev/i2c-1 -a 94"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
bw_tool -a 94 -I -D /dev/i2c-1 ( also works fine )
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
apt-get install bc
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
0040
To edit the info
nano ui
Which has to change in to:
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
1000
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
The remove the latest one and see the newest you are doing it again
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
Code that I used: http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example
( ui voor showtemp om werkende te krijgen time to wait )
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
nano friet
add this text:
( folder with a random name I called it friet. )
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
do like the other times:
chmod +x friet
[[File:Temperature.png|400px|thumb|none|]]
On [[Blog 06]] I combined the temperature sensor and the time on the screen.
8eda1af2e7148d3b38b1fe260d01438c9e2061d8
3175
3172
2015-09-11T15:01:35Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Finally the temperature sensor:
This will be a temperature sensor including the time.
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
chmod +x ui
ls -l ui
Which will give as result:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
./ui
#!/bin/sh
ui="bw_tool -I -D /dev/i2c-1 -a 94"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
bw_tool -a 94 -I -D /dev/i2c-1 ( also works fine )
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
apt-get install bc
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
0040
To edit the info
nano ui
Which has to change in to:
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
1000
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
The remove the latest one and see the newest you are doing it again
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
Code that I used: http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example
( ui voor showtemp om werkende te krijgen time to wait )
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
nano friet
add this text:
( folder with a random name I called it friet. )
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
do like the other times:
chmod +x friet
[[File:Temperature.png|400px|thumb|none|]]
On [[Blog 06]] I combined made it possible to show the time and temperature on the display.
3fde9ba4798eb72702970d166fc948523ff60de4
Blog 06
0
1796
3159
2015-09-11T12:02:24Z
Cartridge1987
2553
In this text harry makes a combination from the timer and the temperature visible
wikitext
text/x-wiki
== !BETA! ==
Now we will also add the time under the temperature:
Here for we combine the codes together.
We have the previous timer code
where we remove the other information
on the top we put the temperature: 11:00b ( 00 for the first row 11 for display )
which is connected with the code of; showtimer.
and on the second row the timer. ( 11:20b )
I made a new folder called: Koekje
+ with all the files referencing: Koekje.
#!/bin/bash
# What display to use:
Koekje="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$Koekje -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#show temperature
$Koekje -W 11:00:b
$Koekje -t "temp: "`./showtemp`
#print the current time
$Koekje -W 11:20:b
$Koekje -t `date +%H:%M:%S`
#idle for 5 seconds
sleep 5
done
./Koekje
[[File:DSC05993TSE.png|400px|thumb|left|This picture was taken on the same moment it changed from time]]
20b35151037cfaee1dd41c9482ae2fba77869748
3173
3159
2015-09-11T14:59:27Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Now we will also add the time under the temperature:
Here for we combine the codes together.
We have the previous timer code
where we remove the other information
on the top we put the temperature: 11:00b ( 00 for the first row 11 for display )
which is connected with the code of; showtimer.
and on the second row the timer. ( 11:20b )
I made a new folder called: Koekje
+ with all the files referencing: Koekje.
#!/bin/bash
# What display to use:
Koekje="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$Koekje -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#show temperature
$Koekje -W 11:00:b
$Koekje -t "temp: "`./showtemp`
#print the current time
$Koekje -W 11:20:b
$Koekje -t `date +%H:%M:%S`
#idle for 5 seconds
sleep 5
done
./Koekje
[[File:DSC05993TSE.png|400px|thumb|left|This picture was taken on the same moment it changed from time]]
On [[Blog 07]] I am going to use the buttons to print text on the display.
69d0632040d3b0d0161a39fb5fe1bea525b3d8ea
3174
3173
2015-09-11T14:59:57Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Now we will also add the time under the temperature:
Here for we combine the codes together.
We have the previous timer code
where we remove the other information
on the top we put the temperature: 11:00b ( 00 for the first row 11 for display )
which is connected with the code of; showtimer.
and on the second row the timer. ( 11:20b )
I made a new folder called: Koekje
+ with all the files referencing: Koekje.
#!/bin/bash
# What display to use:
Koekje="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$Koekje -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#show temperature
$Koekje -W 11:00:b
$Koekje -t "temp: "`./showtemp`
#print the current time
$Koekje -W 11:20:b
$Koekje -t `date +%H:%M:%S`
#idle for 5 seconds
sleep 5
done
./Koekje
[[File:DSC05993TSE.png|400px|thumb|none|This picture was taken on the same moment it changed from time]]
On [[Blog 07]] I am going to use the buttons to print text on the display.
7ec9b66c0ad81988e360e7c62d43b911db65cd90
Blog 07
0
1797
3160
2015-09-11T12:18:49Z
Cartridge1987
2553
In this text harry makes it possible to use the buttons for printing text on the screen
wikitext
text/x-wiki
== !BETA! ==
first try to see if it can detect the raspberry pi button to make sure if it works I choose to detect the middle number 3.
so we read button 23:s
without pressing the button it says;
0101
and with pressing the right button it says
0000
$ bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s
0101
$ bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s
0000
When we make a shell we have to put the code:
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t Friet is lekker`
fi
in ir
it will look if the place is 0000
and then if that is true it will print the text
after that it is finished
what I found out is that the numbers are mirrored so:
20:s = 6
25:s = 1
Now to try the full 6 buttons!
When in mirror in mind we make this code:
#!/bin/bash
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 25:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t W`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 24:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t i`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t z`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 22:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t a`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 21:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t r`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 20:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t d`
fi
with this code you sadly always have to activate it with
./type
now we have to make it possible you can just keep typing and don't have to turn it on again after every time you entered
./type.
#!/bin/bash
while true; do
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 25:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t W`
sleep 0.4
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 24:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t i`
sleep 0.4
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t z`
sleep 0.4
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 22:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t a`
sleep 0.4
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 21:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t r`
sleep 0.4
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 20:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t d`
sleep 0.4
fi
done
[[File:Wiz.png|400px|thumb|left|]][[File:Wizard.png|400px|thumb|right|]]
for now I added sleep 0.4 sec after every echo
but this doesn't help because now people have to type slower or faster if you change the time. !BETA!
dc810569777cba031adac5a992c9dfc09c41a3de
Blog list
0
1798
3161
2015-09-11T12:40:35Z
Cartridge1987
2553
Overview
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
*[[blog 01]] - Starting up the Raspberry Pi
*[[blog 02]] - Turning on and off a lamp with a Raspberry Relay
*[[blog 03]] - !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[blog 04]] - !BETA!Use the RPi_UI board as clock
*[[blog 05]] - !BETA!Use the RPi_UI board to show the temperature
*[[blog 06]] - !BETA!Make the RPi_UI board display the time and temperature
*[[blog 07]] - !BETA!Use the push buttons of the RPi_UI board to print text on it
d5cf7eb8a82e9d4554fc1fe71376d445a3070a52
3162
3161
2015-09-11T12:42:06Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
*[[Blog 01]] - Starting up the Raspberry Pi
*[[Blog 02]] - Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - !BETA!Use the push buttons of the RPi_UI board to print text on it
75fc61a7b9a36afc891f8fcf09838dc87da0f662
Blog 03
0
1793
3176
3169
2015-09-11T15:27:44Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that this all eventually didn't work on my display the raspberry was saying:
I2C_rpi_ui 1.6
A: 94
[[File:94.png|300px|thumb|none|]]
As you can see on the image
But if you don't have that and have that the raspberry is saying something like;
A: 1
you have to change this or always write to
a -1 to say Hello, Dave.
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
with i2cdetect you will also get this:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
But you can change the problem with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
and to remove and connect the display again.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now we can explore the things we can do with the Raspberry interface.
Go to [[Blog 04]], where I will print the time on the display.
8ffeee79f3a030593280d4b466cc35e1a25d3e27
3178
3176
2015-09-16T10:10:33Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that rebooting didn't help for me getting to see A: 94. On my Display was the text visible:
I2C_rpi_ui 1.6
A: 1
[[File:94.png|300px|thumb|none|]]
On the image you can see how it actually has to look like.
If you have A:1 you have to write:
-a 1
instead of:
-a 94
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
with i2cdetect you will also get this:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
You can change A: 1 to A: 94 with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
After this command: remove and connect the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now it is fixed we can explore the things we can do with the Raspberry interface!
Go to [[Blog 04]], where I will make it possible to use the Raspberry interface as clock.
5e1cc1ead5c9af7702fa35b9646cb040ac3cce35
3179
3178
2015-09-16T10:12:27Z
Cartridge1987
2553
/* Change A: X to A: 94 */
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that rebooting didn't help for me getting to see A: 94. On my Display was the text visible:
I2C_rpi_ui 1.6
A: 1
[[File:94.png|300px|thumb|none|]]
On the image you can see how it actually has to look like.
If you have A:1 you have to write:
-a 1
instead of:
-a 94
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
When you do i2cdetect as above you will get the same result but than without the 4a visible:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
You can change A: 1 to A: 94 with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
After this command: remove and connect the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
to restart the display
Now it is fixed we can explore the things we can do with the Raspberry interface!
Go to [[Blog 04]], where I will make it possible to use the Raspberry interface as clock.
60cab4c15d584b2f5cb0ea7496c96a356a2933f1
3220
3179
2015-09-21T13:06:45Z
Cartridge1987
2553
/* Change A: X to A: 94 */
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that rebooting didn't help for me getting to see A: 94. On my Display was the text visible:
I2C_rpi_ui 1.6
A: 1
[[File:94.png|300px|thumb|none|]]
On the image you can see how it actually has to look like.
If you have A:1 you have to write:
-a 1
instead of:
-a 94
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
When you do i2cdetect as above you will get the same result but than without the 4a visible:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
You can change A: 1 to A: 94 with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
After this command: remove and connect the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
The above command is to reconnect the display.
Now it is fixed we can explore the things we can do with the Raspberry interface!
Go to [[Blog 04]], where I will make it possible to use the Raspberry interface as clock.
8e7ac9cfb6605bf5a0e700ebf70a762f32cb30c7
3224
3220
2015-09-21T15:55:38Z
Cartridge1987
2553
/* Change A: X to A: 94 */
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that rebooting didn't help for me getting to see A: 94. On my Display was the text visible:
I2C_rpi_ui 1.6
A: 1
[[File:94.png|300px|thumb|none|]]
On the image you can see how it normally has to look like.
If you have A:1 you have to write:
-a 1
instead of:
-a 94
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
When you do i2cdetect as above you will get the same result but than without the 4a visible:
modprobe i2c-dev
i2cdetect -y 1
but then without the 4a displayed on your screen.
You can change A: 1 to A: 94 with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
After this command: remove and connect the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
The above command is to reconnect the display.
Now it is fixed we can explore the things we can do with the Raspberry interface!
Go to [[Blog 04]], where I will make it possible to use the Raspberry interface as clock.
e35730d850b7df7f35db79b90e5eb64b60c1ad7d
Blog 01
0
1784
3177
3167
2015-09-15T13:11:02Z
Cartridge1987
2553
changing password tutorial
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this [[Blog list]] I will keep you posted about my Raspberry Pi projects.
The first thing I want to happen is to get the Raspberry Pi to work.
For this I had to download the software:
[https://www.raspberrypi.org/downloads/raspbian/ Raspbian ]
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry site.] I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code:
df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
When the green led is blinking it means, that there are no problems with the Raspberry Pi.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the PI using it's IP address. For the IP address, consult your system administrator. Or sometimes your router's status page.
You can find your own ip-address on linux by typing in the terminal:
sudo ifconfig
Your IP-adress will be visible after:
inet addr:
So on my PI was visible:
inet addr:192.168.234.66
(but you can't do that until you have a connection. On the other hand, you can do that if you (temporarily) have a monitor and keyboard connected)
It then asks about the Password. That is: "raspberry" ( That is the password of the pi user on every Raspbian install, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
== Changing password ==
To change the password on the Raspberry Pi, you have to type:
passwd
Your new pass word has to be at least 6 letters!
Also it will check if the password isn't too easy. ( so try to also use numbers and capital letters )
Otherwise you will get:
Bad: new password is too simple
Your password will be invisible, while typing. So look closely at what you are typing!
ffd3c6cd5dea5058d6ce58335507d456f8b4d0d4
3206
3177
2015-09-17T12:20:36Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this [[Blog list]] I will keep you posted about my Raspberry Pi projects.
The first thing I want to happen is to get the Raspberry Pi to work.
For this I had to download the software:
[https://www.raspberrypi.org/downloads/raspbian/ Raspbian ]
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry site.] I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code:
df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
When the green led is blinking it means, that there are no problems with the Raspberry Pi.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the PI using it's IP address. For the IP address, consult your system administrator. Or sometimes your router's status page.
You can find your own ip-address on linux by typing in the terminal:
sudo ifconfig
Your IP-adress will be visible after:
inet addr:
So on my PI was visible:
inet addr:192.168.234.66
(but you can't do that until you have a connection. On the other hand, you can do that if you (temporarily) have a monitor and keyboard connected)
It then asks about the Password. That is: "raspberry" ( That is the password of the pi user on every Raspbian install, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
== Changing password ==
To change the password on the Raspberry Pi, you have to type:
passwd
Your new pass word has to be at least 6 letters!
Also it will check if the password isn't too easy. ( so try to also use numbers and capital letters )
Otherwise you will get:
Bad: new password is too simple
Your password will be invisible, while typing. So look closely at what you are typing!
d3e43fcbed5b3426fccd033298cccae43aaa753f
3207
3206
2015-09-17T13:13:13Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this [[Blog list]] I will keep you posted about my Raspberry Pi projects.
The first thing I want to happen is to get the Raspberry Pi to work.
For this I had to download the software:
[https://www.raspberrypi.org/downloads/raspbian/ Raspbian ]
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry site.] I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code:
df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
You have to wait when the green flickering led is done.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the PI using it's IP address. For the IP address, consult your system administrator. Or sometimes your router's status page.
You can find your own ip-address on linux by typing in the terminal:
sudo ifconfig
Your IP-adress will be visible after:
inet addr:
So on my PI was visible:
inet addr:192.168.234.66
(but you can't do that until you have a connection. On the other hand, you can do that if you (temporarily) have a monitor and keyboard connected)
It then asks about the Password. That is: "raspberry" ( That is the password of the pi user on every Raspbian install, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
== Changing password ==
To change the password on the Raspberry Pi, you have to type:
passwd
Your new pass word has to be at least 6 letters!
Also it will check if the password isn't too easy. ( so try to also use numbers and capital letters )
Otherwise you will get:
Bad: new password is too simple
Your password will be invisible, while typing. So look closely at what you are typing!
0080878f7760ffd6b5bc02d3b4805e38d20e48da
3221
3207
2015-09-21T13:07:45Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
My name is Harry. I just started learning to work with the Raspberry Pi.
( I have the Raspberry Pi 2 ) In this [[Blog list]] I will keep you posted about my Raspberry Pi projects.
The first thing I want to happen is to get the Raspberry Pi to work.
For this I had to download the software:
[https://www.raspberrypi.org/downloads/raspbian/ Raspbian ]
To get Raspbian on my 4 gigabyte micro-SD card, I had to follow the steps from the [https://www.raspberrypi.org/documentation/installation/installing-images/ Raspberry site.] I used the linux version. First I had to get the micro-SD to work with my computer. What I did was to get the micro-SD card in a Micro SD-adapter.
To look if the computer could find the device I had to write in my terminal the code:
df -h
The results was that I got the a big list of hardware that it saw. All down in the list was my micro-SD with the names
/dev/sda1 & /dev/sda2
Note: This is unusual. (Normally it would be sdb or sdc )
To make my micro-SD open for editing I used the command:
umount /dev/sda1
To eventually get the file over on the Micro-SD:
dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sda
This took around 10 minutes.
At last I did:
sync
To make sure that it is safe to take the micro-SD out.
Now the Micro-SD has Raspbian it is time to get the Raspberry Pi to work.
After I unpackaged the Raspberry Pi, I first had to connect it with my monitor. For this I didn't use a hdmi, like what normally everybody does. I connected my Raspberry Pi with an Ethernet cable to my router that is connected with my PC. The main reason I did this was that my monitor didn't support hdmi and that it I now could use my Raspberry Pi on a window, while continuing to work on my workstation. With that I could search for advice on the Internet for programming the Raspberry Pi, while working on it.
Now it is time to turn on the Raspberry Pi to put a micro-usb charger in it.
You have to wait until the green flickering led is done.
Now on the computer I have to open a terminal. I do this by doing: CTRL + ALT + T(linux)
( In windows you have to open cmd. )
In the terminal I have to write:
ssh pi@192.168.234.66
This is for to connect to the PI using it's IP address. For the IP address, consult your system administrator. Or sometimes your router's status page.
You can find your own ip-address on linux by typing in the terminal:
sudo ifconfig
Your IP-adress will be visible after:
inet addr:
So on my PI was visible:
inet addr:192.168.234.66
(but you can't do that until you have a connection. On the other hand, you can do that if you (temporarily) have a monitor and keyboard connected)
It then asks about the Password. That is: "raspberry" ( That is the password of the pi user on every Raspbian install, until the owner of the Pi of course changes the password. )
When you type the letters and the amount of letters will not be visible.
Now I can type terminal commands to the Raspberry! And work on Raspberry Pi projects!
== Changing password ==
To change the password on the Raspberry Pi, you have to type:
passwd
Your new pass word has to be at least 6 letters!
Also it will check if the password isn't too easy. ( so try to also use numbers and capital letters )
Otherwise you will get:
Bad: new password is too simple
Your password will be invisible, while typing. So look closely at what you are typing!
b39fd7287db3ae48ecc9857fe3927d15eb2d62ae
Blog 04
0
1794
3180
3170
2015-09-16T10:44:59Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
In this blog, I am going to show how to make a clock including load averages visible on your RPi_UI board's display.
The code I used is:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
( Reference to which display to use
$DISPL -W 10:0:b
bytes
load
)
( use ctrl c to get out of the code ) ( ctrl z to let the code continue )
nano timer
sh timer
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sh mods.x^C
chmod +x timer
ls -l
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 timer
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
./timer
With my raspberry I sadly had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually:
to see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
Give the current date:
month-day-hours-minutes – year . seconds
( always add a zero before a number than is under 10! so 8 = 08 )
So 12:13:14 7 september 2015 becomes:
090712132015.14
date 090711002015.00
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
[[File:RaspberryPiClock.png|400px|thumb|left|]]
( when you turn it off and of by ctrl x and z it will also just come back to the right time. )
On [[Blog 05]] I will print the temperature on the display.
b6221bbecd56a8a7daa9541b09438bfa4cc85aab
3181
3180
2015-09-16T10:45:24Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
In this blog, I am going to show how to make a clock including load averages visible on your RPi_UI board's display.
The code I used is:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
( Reference to which display to use
$DISPL -W 10:0:b
bytes
load
)
( use ctrl c to get out of the code ) ( ctrl z to let the code continue )
nano timer
sh timer
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sh mods.x^C
chmod +x timer
ls -l
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 timer
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
./timer
With my raspberry I sadly had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually:
to see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
Give the current date:
month-day-hours-minutes – year . seconds
( always add a zero before a number than is under 10! so 8 = 08 )
So 12:13:14 7 september 2015 becomes:
090712132015.14
date 090711002015.00
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
[[File:RaspberryPiClock.png|400px|thumb|none|]]
( when you turn it off and of by ctrl x and z it will also just come back to the right time. )
On [[Blog 05]] I will print the temperature on the display.
47e346451ecca42d23c12939e89a2ee5e94574d9
3182
3181
2015-09-16T11:23:33Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
In this blog, I am going to show how to make a clock including load averages visible on your RPi_UI board's display.
The code I used is:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
Code extra explanation:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
This code is made so you don't have a big mess of a code. The codes with $DISPL reference to this code.
So instead of always typing bw_tool -I -D /dev/i2c-1 -a 94, he directly knows he has to use the one form DISPL, which is the same.
$DISPL -W 10:0:b
The -W 10:00 removes the previous text, and the :b is for doing it in bytes. This is not really needed but, with it you know for sure every command is going fine.
*
$DISPL -W 11:00:b
-W -11:00 is for defining on which line you want your text. That is for 11:00 the first line and with 11:20 the second line.
load
)
( use ctrl c to get out of the code ) ( ctrl z to let the code continue )
nano timer
sh timer
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sh mods.x^C
chmod +x timer
ls -l
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 timer
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
./timer
With my raspberry I sadly had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually:
to see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
Give the current date:
month-day-hours-minutes – year . seconds
( always add a zero before a number than is under 10! so 8 = 08 )
So 12:13:14 7 september 2015 becomes:
090712132015.14
date 090711002015.00
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
[[File:RaspberryPiClock.png|400px|thumb|none|]]
( when you turn it off and of by ctrl x and z it will also just come back to the right time. )
On [[Blog 05]] I will print the temperature on the display.
ebda25b9c7d8980da432ecb0c04ebb1e0a0d6d95
3183
3182
2015-09-16T11:48:20Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
In this blog, I am going to show how to make a clock including load averages visible on your RPi_UI board's display.
The code I putted in a script is:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
Code extra explanation:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
This code is made so you don't have a big mess of a code. The codes with $DISPL reference to this code.
So instead of always typing bw_tool -I -D /dev/i2c-1 -a 94, he directly knows he has to use the one form DISPL, which is the same.
$DISPL -W 10:0:b
The -W 10:00 removes the previous text, and the :b is for doing it in bytes. This is not really needed but, with it you know for sure every command is going fine.
*
$DISPL -W 11:00:b
-W -11:00 is for defining on which line you want your text. That is for 11:00 the first line and with 11:20 the second line.
To make script you have to do:
nano Clock
( You can change the name Clock also with something else. )
In the script you have to copy paste the code from above. ( Note: If you don't have a i2c-1 you of course have to use something else )
./Clock or sh Clock
To run it. This gave a error.
You have to add
chmod +x timer
To make your command for running Clock.
Do:
ls -l
To look which commands are executable:
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 Clock
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
If the x's are visible in your line you can use it.
./Clock or sh Clock
[[File:RaspberryPiClock.png|400px|thumb|none|]]
== Change Time ==
With my raspberry I had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually.
To see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
To Give the current date:
month-day-hours-minutes – year . seconds
( Always add a zero before a number than is under 10! so 8 = 08 )
Example of time:
12:13:14 7 september 2015 becomes:
090712132015.14
To use it add date for it:
date 090711002015.00
The terminal will print out:
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
The Raspberry Pi will remember the time you gave it so don't be scared to turn off or reboot your Raspberry Pi!
On [[Blog 05]] I will print the temperature on the display.
717a4979491ddfcd5ec8d4aea4c03314fcc70982
3222
3183
2015-09-21T13:10:06Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
In this blog, I am going to show how to make a clock including load averages visible on your RPi_UI board's display.
The code I putted in a script is:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
Code extra explanation:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
This code is made so you don't have a big mess of a code. The codes with $DISPL reference to this code.
So instead of always typing bw_tool -I -D /dev/i2c-1 -a 94, he directly knows he has to use the one form DISPL, which is the same.
$DISPL -W 10:0:b
The -W 10:00 removes the previous text, and the :b is for doing it in bytes. This is not really needed but, with it you know for sure every command is going fine.
*
$DISPL -W 11:00:b
-W -11:00 is for defining on which line you want your text. That is for 11:00 the first line and with 11:20 the second line.
To make script you have to do:
nano Clock
( You can change the name Clock also with something else. )
In the script you have to copy paste the code from above. ( Note: If you don't have a i2c-1 you of course have to use something else )
./Clock
To run it. This gave a error.
You have to add
chmod +x timer
To make your command for running Clock.
Do:
ls -l
To look which commands are executable:
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 Clock
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
If the x's are visible in your line you can use it.
./Clock
[[File:RaspberryPiClock.png|400px|thumb|none|]]
If you also want the year to appear, you have to add %F-:
date +%F_%H-%M-%S
== Change Time ==
With my raspberry I had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually.
To see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
To Give the current date:
month-day-hours-minutes – year . seconds
( Always add a zero before a number than is under 10! so 8 = 08 )
Example of time:
12:13:14 7 september 2015 becomes:
090712132015.14
To use it add date for it:
date 090711002015.00
The terminal will print out:
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
The Raspberry Pi will remember the time you gave it so don't be scared to turn off or reboot your Raspberry Pi!
On [[Blog 05]] I will print the temperature on the display.
fea52a8e8ffaeeb91caa10fd4adaf7d094bef83d
3223
3222
2015-09-21T15:52:14Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
In this blog, I am going to show how to make a clock including load averages visible on your RPi_UI board's display.
The code I putted in a script is:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
Code used from the [http://www.bitwizard.nl/wiki/index.php/User_Interface User Interface page.]
Code extra explanation:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
This code is made so you don't have a big mess of a code. The codes with $DISPL reference to this code.
So instead of always typing bw_tool -I -D /dev/i2c-1 -a 94, he directly knows he has to use the one form DISPL, which is the same.
$DISPL -W 10:0:b
The -W 10:00 removes the previous text, and the :b is for doing it in bytes. This is not really needed but, with it you know for sure every command is going fine.
*
$DISPL -W 11:00:b
-W -11:00 is for defining on which line you want your text. That is for 11:00 the first line and with 11:20 the second line.
To make script you have to do:
nano Clock
( You can change the name Clock also with something else. )
In the script you have to copy paste the code from above. ( Note: If you don't have a i2c-1 you of course have to use something else )
./Clock
To run it. This gave a error.
You have to add
chmod +x timer
To make your command for running Clock.
Do:
ls -l
To look which commands are executable:
total 56
-rw-r--r-- 1 root root 0 Sep 3 14:10 _
drwxr-xr-x 5 pi pi 4096 Sep 3 10:27 bw_rpi_tools
drwxrwxr-x 2 pi pi 4096 Jan 27 2015 python_games
-rwxr-xr-x 1 root root 480 Sep 7 08:47 Clock
drwxr-xr-x 9 pi pi 4096 Aug 31 14:04 wiringPi
If the x's are visible in your line you can use it.
./Clock
[[File:RaspberryPiClock.png|400px|thumb|none|]]
If you also want the day, month and year to appear, you have to add %F:
date +%F:%H:%M:%S
== Change Time ==
With my raspberry I had the problem that it was 2 hours earlier in time. So, I had to change it to the correct current time.
I changed the time manually.
To see the current time:
uname -a
Linux seniorservix 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux
To Give the current date:
month-day-hours-minutes – year . seconds
( Always add a zero before a number than is under 10! so 8 = 08 )
Example of time:
12:13:14 7 september 2015 becomes:
090712132015.14
To use it add date for it:
date 090711002015.00
The terminal will print out:
Mon Sep 7 11:00:00 UTC 2015
At this point the original time was still visible on the screen. So I removed it from the screen and printed it out again.
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
./timer
It directly printed the correct time that I gave.
The Raspberry Pi will remember the time you gave it so don't be scared to turn off or reboot your Raspberry Pi!
On [[Blog 05]] I will print the temperature on the display.
5fcfee266e8d65f53f12de35b9ed847ff323434e
Blog 06
0
1796
3184
3174
2015-09-16T12:14:36Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Now we will also add the time under the temperature:
For this we will combine the codes together.
For making this I used the previous timer script.
Where we remove some information
On the top we put the temperature: 11:00b ( 00 for the first row 11 for display )
The is connected with the code of; ./showtemp.
and on the second row the timer. ( 11:20b )
Where I just used +%H:%M:%S`. I could also just use ./Timer, but if I do that I have to remove the load averages of the script.
The name I gave this script is TimeTemp:
#!/bin/bash
# What display to use:
DISP="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISP -W 10:0:b
while true; do
#show temperature
$DISP -W 11:00:b
$DISP -t "temp: "`./showtemp`
#print the current time
$DISP -W 11:20:b
$DISP -t `date +%H:%M:%S`
#idle for 5 seconds
sleep 5
done
./TimeTemp
The result:
[[File:DSC05993TSE.png|400px|thumb|none|This picture was taken on the same moment it changed from time]]
*
On [[Blog 07]] I am going to use the buttons to print text on the display.
76a951c97164046efdd5acb52f93cf75b8b68b35
3185
3184
2015-09-16T12:15:09Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Now we will also add the time under the temperature:
For this we will combine the codes together.
For making this I used the previous timer script.
Where we remove some information
On the top we put the temperature: 11:00b ( 00 for the first row 11 for display )
The is connected with the code of; ./showtemp.
and on the second row the timer. ( 11:20b )
Where I just used +%H:%M:%S. I could also just use ./Timer, but if I do that I have to remove the load averages of the script.
The name I gave this script is TimeTemp:
#!/bin/bash
# What display to use:
DISP="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISP -W 10:0:b
while true; do
#show temperature
$DISP -W 11:00:b
$DISP -t "temp: "`./showtemp`
#print the current time
$DISP -W 11:20:b
$DISP -t `date +%H:%M:%S`
#idle for 5 seconds
sleep 5
done
./TimeTemp
The result:
[[File:DSC05993TSE.png|400px|thumb|none|This picture was taken on the same moment it changed from time]]
*
On [[Blog 07]] I am going to use the buttons to print text on the display.
adf1cf4726322b687fefb8dbb761555af2b40761
3186
3185
2015-09-16T12:16:39Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Now we will also add the time([[blog 04]]) under the temperature([[blog 05]]):
For this we will combine the codes together.
For making this I used the previous timer script.
Where we remove some information
On the top we put the temperature: 11:00b ( 00 for the first row 11 for display )
The is connected with the code of; ./showtemp.
and on the second row the timer. ( 11:20b )
Where I just used +%H:%M:%S. I could also just use ./Timer, but if I do that I have to remove the load averages of the script.
The name I gave this script is TimeTemp:
#!/bin/bash
# What display to use:
DISP="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISP -W 10:0:b
while true; do
#show temperature
$DISP -W 11:00:b
$DISP -t "temp: "`./showtemp`
#print the current time
$DISP -W 11:20:b
$DISP -t `date +%H:%M:%S`
#idle for 5 seconds
sleep 5
done
./TimeTemp
The result:
[[File:DSC05993TSE.png|400px|thumb|none|This picture was taken on the same moment it changed from time]]
*
On [[Blog 07]] I am going to use the buttons to print text on the display.
60ffd3bdf00d5dede83deaba834885c26b2bdae8
Blog 05
0
1795
3187
3175
2015-09-16T13:19:33Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Now the temperature sensor:
For making the temperature sensor we have to make 2 script.
Script 1(The name I gave it was: ui):
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
After this we make ui executable:
chmod +x ui
And look if it worked:
ls -l ui
This result should have -rwxr-xr-x like me:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
Ater you see it works activate it:
./ui
( There will be nothing visible on screen when you activate it )
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
apt-get install bc
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
0040
To edit the info
nano ui
Which has to change in to:
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
1000
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
The remove the latest one and see the newest you are doing it again
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
Code that I used: http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example
( ui voor showtemp om werkende te krijgen time to wait )
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
nano friet
add this text:
( folder with a random name I called it friet. )
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
do like the other times:
chmod +x friet
[[File:Temperature.png|400px|thumb|none|]]
On [[Blog 06]] I combined made it possible to show the time and temperature on the display.
9127f1b96e6aeb0ddc6c70ad91710429ec367973
3188
3187
2015-09-16T13:20:22Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Now the temperature sensor:
For making the temperature sensor we have to make 2 script.
Script 1(The name I gave it was: ui):
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7 # internal tempsens with internal 1.1V as reference
$ui -W 71:c6 # external tempsens with internal 1.1V as reference
$ui -W 81:1000
$ui -W 82:6
$ui -W 80:2
After this we make ui executable:
chmod +x ui
And look if it worked:
ls -l ui
This result should have -rwxr-xr-x like me:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
Ater you see it works activate it:
./ui
( There will be nothing printed out when you activate it )
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
apt-get install bc
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
0040
To edit the info
nano ui
Which has to change in to:
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
bw_tool -I -D /dev/i2c-1 -a 94 -R 81:s
1000
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
The remove the latest one and see the newest you are doing it again
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
Code that I used: http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example
( ui voor showtemp om werkende te krijgen time to wait )
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
nano friet
add this text:
( folder with a random name I called it friet. )
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
do like the other times:
chmod +x friet
[[File:Temperature.png|400px|thumb|none|]]
On [[Blog 06]] I combined made it possible to show the time and temperature on the display.
7dadf402e233eaf6f39d25a2b3d8ff5d9eb4229f
3189
3188
2015-09-16T13:41:05Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Now the temperature sensor:
For making the temperature sensor we have to make 2 script.
Script 1(The name I gave it was: ui):
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
After this we make ui executable:
chmod +x ui
And look if it worked:
ls -l ui
This result should have -rwxr-xr-x like me:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
Ater you see it works activate it:
./ui
( There will be nothing printed out when you activate it )
Now it's time to make the second script. ( I named it showtemp)
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -I -D /dev/i2c-1 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
After that we make is executable, like we did with the ui script.
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
We trying it out I got failures, because I didn't download bc.:
apt-get install bc
To check if your scripts work:
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
If a line is wrong it should give a warning.
So now everything is fine it is time to print it out:
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
[[File:Temperature.png|400px|thumb|none|]]
(The remove the latest temperature and see the newest one:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
)
Code that I used: [[http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example Temperature Sensor example]]
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
I made the script(Temp5):
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
Do like the other times:
chmod +x Temp5
And now when you do:
./Temp5
He will print the temperature every 5 seconds.
On [[Blog 06]] I combined made it possible to show the time and temperature on the display.
ef24107e172e2bfb48b1b17ba1e196dc042fd5e9
3190
3189
2015-09-16T13:41:52Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Now the temperature sensor:
For making the temperature sensor we have to make 2 script.
Script 1(The name I gave it was: ui):
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
After this we make ui executable:
chmod +x ui
And look if it worked:
ls -l ui
This result should have -rwxr-xr-x like me:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
Ater you see it works activate it:
./ui
( There will be nothing printed out when you activate it )
*
Now it's time to make the second script. ( I named it showtemp)
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -I -D /dev/i2c-1 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
After that we make is executable, like we did with the ui script.
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
We trying it out I got failures, because I didn't download bc.:
apt-get install bc
To check if your scripts work:
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
If a line is wrong it should give a warning.
So now everything is fine it is time to print it out:
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
[[File:Temperature.png|400px|thumb|none|]]
(The remove the latest temperature and see the newest one:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
)
Code that I used: [[http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example Temperature Sensor example]]
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
I made the script(Temp5):
#!/bin/bash
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
Do like the other times:
chmod +x Temp5
And now when you do:
./Temp5
He will print the temperature every 5 seconds.
On [[Blog 06]] I combined made it possible to show the time and temperature on the display.
101a66f8034341d823bf5f47a7dd99007ac554fc
3218
3190
2015-09-21T12:33:18Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Now the temperature sensor:
For making the temperature sensor we have to make 2 script.
Script 1(The name I gave it was: ui):
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
After this we make ui executable:
chmod +x ui
And look if it worked:
ls -l ui
This result should have -rwxr-xr-x like me:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
Ater you see it works activate it:
./ui
( There will be nothing printed out when you activate it )
*
Now it's time to make the second script. ( I named it showtemp)
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -I -D /dev/i2c-1 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
After that we make is executable, like we did with the ui script.
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
We trying it out I got failures, because I didn't download bc.:
apt-get install bc
To check if your scripts work:
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
If a line is wrong it should give a warning.
So now everything is fine it is time to print it out:
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
[[File:Temperature.png|400px|thumb|none|]]
(The remove the latest temperature and see the newest one:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
)
Code that I used: [[http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example Temperature Sensor example]]
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
I made the script(Temp5):
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
Do like the other times:
chmod +x Temp5
And now when you do:
./Temp5
He will print the temperature every 5 seconds.
On [[Blog 06]] I combined made it possible to show the time and temperature on the display.
ef30b8d2f3a75b54fb04d71a45a0bf011a8babcf
3219
3218
2015-09-21T12:33:45Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Now the temperature sensor:
For making the temperature sensor we have to make 2 script.
Script 1(The name I gave it was: ui):
#!/bin/sh
ui="bw_tool -a 94 -I -D /dev/i2c-1"
$ui -W 70:c7:b # internal tempsens with internal 1.1V as reference
$ui -W 71:c6:b # external tempsens with internal 1.1V as reference
$ui -W 81:1000:s
$ui -W 82:6:b
$ui -W 80:2:b
After this we make ui executable:
chmod +x ui
And look if it worked:
ls -l ui
This result should have -rwxr-xr-x like me:
-rwxr-xr-x 1 root root 216 Sep 7 15:46 ui
Ater you see it works activate it:
./ui
( There will be nothing printed out when you activate it )
*
Now it's time to make the second script. ( I named it showtemp)
#!/bin/sh
#
#
# Set the number of samples to 64, and shift by 0, or set the
# number of samples to 4096 and shift by 6. The latter is recommended!
#
adcmaxval=65520
#adcmaxval=1023
#
# MCP9700 degrees per volt.
vperdeg=0.010
#refvoltage=4.9000
refvoltage=1.1000
# mcp offset voltage is 500mv at 0 deg. At 0.010 volt per deg that comes to
# 50 degrees C.
offset=50
#
#
# 60 adc channel 0, direct value (0-1023)
# 68 adc channel 0, averaged value (0-65520 with nsamp=4096, shift=6)
# 61 adc channel 1, direct value (0-1023)
# 69 adc channel 1, averaged value (0-65520 with nsamp=4096, shift=6)
register_to_read=69
#
# settings are done, now the preparations.
convfactor=`(echo scale = 10 ; echo obase=16;echo $refvoltage / $vperdeg / $adcmaxval ) | bc`
offsethex=`(echo obase=16; echo scale=3;echo $offset) | bc `
# now do the real deal.
rawtemp=`sudo bw_tool -I -D /dev/i2c-1 -a 94 -R $register_to_read:s | tr a-z A-Z`
(echo ibase=16; echo scale=3;echo $rawtemp \* $convfactor - $offsethex) | bc
After that we make is executable, like we did with the ui script.
chmod +x showtemp
ls -l showtemp
-rwxr-xr-x 1 pi pi 999 Sep 7 14:26 showtemp
We trying it out I got failures, because I didn't download bc.:
apt-get install bc
To check if your scripts work:
sh -x ./ui
+ ui=bw_tool -a 94 -I -D /dev/i2c-1
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 70:c7:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 71:c6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 81:1000:s
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 82:6:b
+ bw_tool -a 94 -I -D /dev/i2c-1 -W 80:2:b
sh -x ./showtemp
+ adcmaxval=65520
+ vperdeg=0.010
+ refvoltage=1.1000
+ offset=50
+ register_to_read=69
+ + bc
echo scale = 10
+ echo obase=16
+ echo 1.1000 / 0.010 / 65520
+ convfactor=.006E06E01
+ echo obase=16
+ echo+ scale=3
bc+ echo 50
+ offsethex=32
+ sudo bw_tool+ -I -Dtr a-z A-Z
/dev/i2c-1 -a 94 -R 69:s
+ rawtemp=ACC3
+ echo ibase=16
+ echo scale=3
+ echo ACC3 * .006E06E01 - 32
+ bc
24.251648852
If a line is wrong it should give a warning.
So now everything is fine it is time to print it out:
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
[[File:Temperature.png|400px|thumb|none|]]
(The remove the latest temperature and see the newest one:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
)
Code that I used: [[http://www.bitwizard.nl/wiki/index.php/Temperature_sensor_example Temperature Sensor example]]
Now we have this. It may be better that we also get it to refresh around a several second instead we have to type the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp
over and over again.
So I am going to try to mix the previous code with temperature code so it will check the code every amount of time. ( I will take 5 sec )
I made the script(Temp5):
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true;do
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "temp: "`./showtemp`
sleep 5
done
Do like the other times:
chmod +x Temp5
And now when you do:
./Temp5
He will print the temperature every 5 seconds.
On [[Blog 06]] I combined made it possible to show the time and temperature on the display.
748e621660257b87d973f0cfc2ab4d7f095ac7a8
Blog 07
0
1797
3191
3160
2015-09-16T14:12:46Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
I am now going to make it possible to use the Raspberry Interface buttons as some kind of keyboard.
Later I want to make it possible that instead of just printing letters it will print scripts.
I am first going to try to get it work with button 3.
so we read button 23:s
without pressing the button it says;
0101
and with pressing the right button it says
0000
$ bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s
0101
$ bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s
0000
When we make a shell we have to put the code:
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t Bananaphone
fi
It will look if the place is 0000
and then if that is true it will print the text
after that it is finished
what I found out is that the numbers are mirrored so:
20:s = button 6
21:s = button 5
22:s = button 4
23:s = button 3
24:s = button 2
25:s = button 1
Now to try the full 6 buttons!
When the mirror in mind we make this code:
#!/bin/bash
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 25:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t W`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 24:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t i`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t z`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 22:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t a`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 21:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t r`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 20:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t d`
fi
with this code you sadly always have to activate it with
./type
Now we have to make it possible you can just keep typing and don't have to turn it on again after every time you entered
./type.
To do this we will add a sleep of 0.5sec at every button.
#!/bin/bash
while true; do
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 25:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t W`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 24:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t i`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t z`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 22:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t a`
sleep 0.4
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 21:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t r`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 20:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t d`
sleep 0.5
fi
done
[[File:Wiz.png|400px|thumb|left|]][[File:Wizard.png|400px|thumb|right|]]
!BETA!
754eaccf72cb4d676835659d3d0c1064f2b9d204
3192
3191
2015-09-16T14:13:17Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
I am now going to make it possible to use the Raspberry Interface buttons as some kind of keyboard.
Later I want to make it possible that instead of just printing letters it will print scripts.
I am first going to try to get it work with button 3.
so we read button 23:s
without pressing the button it says;
0101
and with pressing the right button it says
0000
$ bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s
0101
$ bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s
0000
When we make a shell we have to put the code:
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t Bananaphone
fi
It will look if the place is 0000
and then if that is true it will print the text
after that it is finished
what I found out is that the numbers are mirrored so:
20:s = button 6
21:s = button 5
22:s = button 4
23:s = button 3
24:s = button 2
25:s = button 1
Now to try the full 6 buttons!
When the mirror in mind we make this code:
#!/bin/bash
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 25:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t W`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 24:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t i`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t z`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 22:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t a`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 21:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t r`
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 20:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t d`
fi
with this code you sadly always have to activate it with
./type
Now we have to make it possible you can just keep typing and don't have to turn it on again after every time you entered
./type.
To do this we will add a sleep of 0.5sec at every button:
#!/bin/bash
while true; do
if [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 25:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t W`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 24:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t i`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 23:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t z`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 22:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t a`
sleep 0.4
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 21:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t r`
sleep 0.5
elif [ `bw_tool -I -D /dev/i2c-1 -a 94 -R 20:s` = "0000" ]; then
echo `bw_tool -I -D /dev/i2c-1 -a 94 -t d`
sleep 0.5
fi
done
[[File:Wiz.png|400px|thumb|left|]][[File:Wizard.png|400px|thumb|right|]]
!BETA!
082743ee5041896ceb4740be084864b5ae3f0a76
Beginners guide to SPI on Raspberry Pi
0
794
3193
2863
2015-09-16T14:36:46Z
Cartridge1987
2553
/* Troubleshooting */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_tool program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -w 16:0
Now your display should be cleared. <br>
See also the [[bw_tool| bw_tool wiki page ]].
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can [http://www.bitwizard.nl/contact.php contact] us, or post your problem in our forum. We will respond as soon as we can.
9301131167e21253203fc3444be4e8916a97849f
3194
3193
2015-09-16T14:39:47Z
Cartridge1987
2553
/* Troubleshooting */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_tool program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -w 16:0
Now your display should be cleared. <br>
See also the [[bw_tool| bw_tool wiki page ]].
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can [http://www.bitwizard.nl/contact.php contact] us, or post your problem in our [http://forum.bitwizard.nl/ forum.] We will respond as soon as we can.
7e81fc7f244d83de9eb0f133fd09612d5049f5fa
3195
3194
2015-09-16T14:42:23Z
Cartridge1987
2553
/* Next steps */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_tool program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -w 10:0
Now your display should be cleared. <br>
See also the [[bw_tool| bw_tool wiki page ]].
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can [http://www.bitwizard.nl/contact.php contact] us, or post your problem in our [http://forum.bitwizard.nl/ forum.] We will respond as soon as we can.
1fcf8603ab53b6fbd0d872d8514a4a9b86d5e421
File:CPU&GPU.jpg
6
1799
3196
2015-09-17T08:44:57Z
Cartridge1987
2553
This image shows the temperature of the cpu and gpu from the raspberry pi printed on the RPi_UI board.
wikitext
text/x-wiki
This image shows the temperature of the cpu and gpu from the raspberry pi printed on the RPi_UI board.
3bbbcfb49ed5d5834b323532336d90e96f1370ab
Blog 08
0
1800
3197
2015-09-17T10:20:20Z
Cartridge1987
2553
Created page with " == CPU & GPU sensor == For this I combined 2 codes. Together they should display the cpu + gpu temperature on your display. And recheck it every 5 seconds. This should than ..."
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. Together they should display the cpu + gpu temperature on your display. And recheck it every 5 seconds. This should than also be visible on your display.
The code for reading the cpu and gpu and the clock code from [[Blog 04]]
The code first gets the cpu temp with thermal_zone0
The result would be something like: 36318
363108 goes trough 1000 to get it too 36 ( it only looks at the full numbers, otherwise it should be 36.318 )
then the line under it does 35780 trough 100, what makes it 363
After we use %. What % does it that is divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of number he still got.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
After that we do the gpu temperature
the result from measure_temp you would normally would look like:
temp=34.7'C
We are going to print 'GPU Temp: 'before it so we don't want temp= to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( sadly the raspberry pi display doesn't know Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down fast!
b2ef8b46421536aeac7303f0e5afcd92795d0128
3198
3197
2015-09-17T10:35:29Z
Cartridge1987
2553
/* CPU & GPU sensor */
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. Together they should display the cpu + gpu temperature on your display. And recheck it every 5 seconds. This should than also be visible on your display.
The code for reading the cpu and gpu and the clock code from [[Blog 04]]
The code first gets the cpu temp with thermal_zone0
The result would be something like: 36318
363108 goes trough 1000 to get it too 36 ( it only looks at the full numbers, otherwise it should be 36.318 )
then the line under it does 35780 trough 100, what makes it 363
After we use %. What % does it that is divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of number he still got.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
The (( )) is always needed at +, *, /, %. ( for the -, ** you always use [[ ]] )
After that we do the gpu temperature
the result from measure_temp you would normally would look like:
temp=34.7'C
We are going to print 'GPU Temp: 'before it so we don't want temp= to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( sadly the raspberry pi display doesn't know Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down fast!
2ad1486f57566407092f6371cd938786768dd36b
3199
3198
2015-09-17T10:36:30Z
Cartridge1987
2553
/* CPU & GPU sensor */
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. Together they should display the cpu + gpu temperature on your display. And recheck it every 5 seconds. This should than also be visible on your display.
The code for reading the cpu and gpu and the clock code from [[Blog 04]]
The code first gets the cpu temp with thermal_zone0
The result would be something like: 36318
363108 goes trough 1000 to get it too 36 ( it only looks at the full numbers, otherwise it should be 36.318 )
then the line under it does 35780 trough 100, what makes it 363
After we use %. What % does it that is divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of number he still got.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
The (( )) is always needed at +, *, /, %. ( for the -, ** you always use [[ ]] )
After that we do the gpu temperature
the result from measure_temp you would normally would look like:
temp=34.7'C
We are going to print 'GPU Temp: 'before it so we don't want temp= to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( sadly the raspberry pi display doesn't know Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down fast!
Look at my other projects at the [[Blog list]]
aead99ebadd021c2ad6bc891e50a5e95488040a3
3201
3199
2015-09-17T10:41:47Z
Cartridge1987
2553
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. Together they should display the cpu + gpu temperature on your display. And recheck it every 5 seconds. This should than also be visible on your display.
The code for reading the cpu and gpu and the clock code from [[Blog 04]]
The code first gets the cpu temp with thermal_zone0
The result would be something like: 36318
363108 goes trough 1000 to get it too 36 ( it only looks at the full numbers, otherwise it should be 36.318 )
then the line under it does 35780 trough 100, what makes it 363
After we use %. What % does it that is divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of number he still got.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
The (( )) is always needed at +, *, /, %. ( for the -, ** you always use [[ ]] )
After that we do the gpu temperature
the result from measure_temp you would normally would look like:
temp=34.7'C
We are going to print 'GPU Temp: 'before it so we don't want temp= to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( sadly the raspberry pi display doesn't know Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down as fast as you can!
Look at my other projects at the [[Blog list]]
1273f63931ca6855f58537f52b4748719f4bff29
3202
3201
2015-09-17T10:52:28Z
Cartridge1987
2553
/* CPU & GPU sensor */
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. Together they should display the CPU + GPU temperature on your display, which should be rechecked every 5 seconds. The temperatures will be visible on your display.
The code for reading [https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=34994&start=25 the cpu and gpu] and the clock code from [[Blog 04]]
The code first gets the cpu temp with thermal_zone0
The result would be something like: 36318
363108 goes trough 1000 to get it too 36 ( it only looks at the full numbers, otherwise it should be 36.318 )
then the line under it does 35780 trough 100, what makes it 363
After we use %. What % does it that is divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of number he still got.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
The (( )) is always needed at +, *, /, %. ( for the -, ** you always use [[ ]] )
After that we do the gpu temperature
the result from measure_temp you would normally would look like:
temp=34.7'C
We are going to print 'GPU Temp: 'before it so we don't want temp= to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( Sadly the raspberry pi display doesn't know the Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down as fast as you can!
Look at my other projects at the [[Blog list]]
c87f0b568e7981f188faacafc22335ac66a68929
3203
3202
2015-09-17T10:57:55Z
Cartridge1987
2553
/* CPU & GPU sensor */
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. (The code for reading [https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=34994&start=25 the cpu and gpu] and the clock code from [[Blog 04]]) Together they should display the CPU + GPU temperature on your display, which should be rechecked every 5 seconds. The temperatures will be visible on your display.
The code first gets the CPU temp with thermal_zone0
The result would be something like: 36318
363108 goes trough 1000 to get it too 36. ( it only looks at the full numbers, otherwise it should be 36.318 )
Then the line under it does 36318 trough 100, what makes it 363
After we use %. What % does is that it divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of numbers it got left.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
The (( )) is always needed at +, *, /, %. ( for the -, ** you always use [[ ]] )
After that we get the GPU temperature.
The result from measure_temp would normally look something like:
temp=34.7'C
We are going to print 'GPU Temp: 'before the temperature, so we don't want 'temp=' to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( Sadly the raspberry pi display doesn't know the Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down as fast as you can!
Look at my other projects at the [[Blog list]]
eb34e56a0edb103d9849021657933c8696307d3d
3204
3203
2015-09-17T11:00:16Z
Cartridge1987
2553
/* CPU & GPU sensor */
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. (The code for reading [https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=34994&start=25 the cpu and gpu] and the clock code from [[Blog 04]]) Together they should display the CPU + GPU temperature on your display, which should be rechecked every 5 seconds. The temperatures will be visible on your display.
The code first gets the CPU temp with thermal_zone0
The result would be something like: 36318.
36318 goes trough 1000 to get it too 36. ( it only looks at the full numbers, otherwise it should be 36.318 )
Then the line under it does 36318 trough 100, what makes it 363
After we use %. What % does is that it divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of numbers it got left.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
The (( )) is always needed at +, *, /, %. ( for the -, ** you always use [[ ]] )
After that we get the GPU temperature.
The result from measure_temp would normally look something like:
temp=34.7'C
We are going to print 'GPU Temp: 'before the temperature, so we don't want 'temp=' to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( Sadly the raspberry pi display doesn't know the Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down as fast as you can!
Look at my other projects at the [[Blog list]]
32c177cc1f2f3c18c74c918783e53c85f4c7451a
3205
3204
2015-09-17T11:00:47Z
Cartridge1987
2553
/* CPU & GPU sensor */
wikitext
text/x-wiki
== CPU & GPU sensor ==
For this I combined 2 codes. (The code for reading [https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=34994&start=25 the cpu and gpu] and the clock code from [[Blog 04]]) Together they should display the CPU + GPU temperature on your display, which should be rechecked every 5 seconds. The temperatures will be visible on your display.
The code first gets the CPU temp with thermal_zone0
The result would be something like: 36318.
36318 goes trough 1000 to get it to 36. ( it only looks at the full numbers, otherwise it should be 36.318 )
Then the line under it does 36318 trough 100, what makes it 363
After we use %. What % does is that it divides 363 with full 36's and the time it can't get divided with 36 it will give the amount of numbers it got left.
(What is of course 3.) This is a smart trick to get the 1 decimal place after the number.
The (( )) is always needed at +, *, /, %. ( for the -, ** you always use [[ ]] )
After that we get the GPU temperature.
The result from measure_temp would normally look something like:
temp=34.7'C
We are going to print 'GPU Temp: 'before the temperature, so we don't want 'temp=' to appear. To remove it we do: gpuTemp0//temp=
to say temp= has to go away
( Sadly the raspberry pi display doesn't know the Celsius mark so I replaced it with: ' )
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp)
gpuTemp0=${gpuTemp0//temp=/}
$DISPL -W 11:00:b
$DISPL -t "CPU Temp: "$cpuTemp1"."$cpuTempM"'C"
$DISPL -W 11:20:b
$DISPL -t "GPU Temp: "$gpuTemp0
sleep 5
done
[[File:CPU&GPU.jpg|400px|thumb|none|]]
The maximum temperature the raspberry pi should get is 70 degrees!
If it is getting higher than 70 degrees it is recommended to cool the Raspberry pi down as fast as you can!
Look at my other projects at the [[Blog list]]
f32c7bddb1248136a17c5044863dc55d728391b2
Blog list
0
1798
3200
3162
2015-09-17T10:37:37Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
*[[Blog 01]] - Starting up the Raspberry Pi
*[[Blog 02]] - Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - Making the RPi_UI board display the Cpu & Gpu temperature
c3c75338fb0b08a325c0824738dd2f9c5d67e15f
3217
3200
2015-09-21T12:14:02Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
*[[Blog 01]] - Starting up the Raspberry Pi
*[[Blog 02]] - Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - Online weather station
1c7160e36871c3b557df5783a34717a14384c938
Blog 09
0
1801
3208
2015-09-18T14:14:09Z
Cartridge1987
2553
Created page with " == BETA! Missing other extra information you can get == == Temperature Station == First look at outside temperature: First you need to install: sudo apt-get install we..."
wikitext
text/x-wiki
== BETA! Missing other extra information you can get ==
== Temperature Station ==
First look at outside temperature:
First you need to install:
sudo apt-get install weather-util
you can type:
weather 'your city/country'
Sadly, it mostly will give a result that is saying that it is ambiguous. It will then give you the option to choose one of the results. Example:
weather rotterdam:
Searching via name...
Your search is ambiguous, returning 3 matches:
[ehrd] Rotterdam Airport Zestienhoven, Netherlands
[fips3609363935] Rotterdam town, NY
[fips3663924] Rotterdam CDP, NY
If you choose the first one you have to type the code between the: [ ]
So if I would choose the first one I should type:
weather ehrd
You can also type the full name of the place if you put it in quotation marks:
'Rotterdam town, NY'
That should also work.
The result with searching a station should look like this( some have extra information. ):
Searching via station...
[caching result Rotterdam Airport Zestienhoven, Netherlands]
Current conditions at Rotterdam Airport Zestienhoven, Netherlands (EHRD) 51-57N 004-27E -4M
Last updated Sep 14, 2015 - 05:25 AM EDT / 2015.09.14 0925 UTC
Temperature: 62 F (17 C)
Relative Humidity: 82%
Wind: from the S (170 degrees) at 12 MPH (10 KT) (direction variable)
Sky conditions: overcast
You can also find out which code to type by going to this website:
https://en.wikipedia.org/wiki/International_Civil_Aviation_Organization_airport_code
On the site if you scroll down you can see the beginning code of every country.
Look in which section your country is.
Well you click on the beginning letters. Like for France:
LF
There you can find the full 4 letter code which you than can type in the line.
So if you want to know the weather in avord(France):
LFOA
Than on the site you will get a list of all the place in France who can give the weather.
If it is for yourself try to find a station as close in your environment.
Note:
When I tested it out. I found out that some weather stations aren't supported any more. (and don't update any more )
As you maybe already figured out loading a temperature form a certain country can become a really long wait. Because it has to go trough a big list of stations until it finds the station you are searching for.
You can save your country as name in the system to make it faster.
I will now take the temperature from: Domodedovo International Airport – Moscow
UUDD
Do:
nano ~/.weatherrc
To go to the weather rc
( the title and description can both be random names the other lines shouldn't be changed. You can also remove the description of course, but takes makes it of course . )
[DIAMoscow]
description = Domodedovo International Airport - Moscow
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
After you saved and exit just type:
weather DIAMoscow
And you will get to see the things you wanted to see in a split-second.
Now to get the Temperature visible on your Rb_ui_board. For this I installed lynx, because if I would read it like previous ways it will print it with ignoring the enter in the file.
apt-get install lynx
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
It will directly print the result:
Moscow / Domodedovo, Russia (UUDD) 55-24N 037-54E
Sep 18, 2015 - 09:00 AM EDT / 2015.09.18 1300 UTC
Wind: from the SSW (200 degrees) at 18 MPH (16 KT):0
Visibility: greater than 7 mile(s):0
Temperature: 78 F (26 C)
Dew Point: 50 F (10 C)
Relative Humidity: 36%
Pressure (altimeter): 29.97 in. Hg (1015 hPa)
ob: UUDD 181300Z 20008MPS CAVOK 26/10 Q1015 R88/010095 NOSIG
cycle: 13
| grep Temperature
With grep temperature added you want to get the line, where it is showing the temperature:
Temperature: 78 F (26 C)
| sed -e 's/.*(//' -e 's/ C).*//'
This will remove everything for and after 26
The 2 commands in sed are:
first command is:
-e 's/.*(//'
This command make it happen that it will disappear everything before 26
The result with only this could would then also be:
26 C)
The second command:
-e 's/).*//'
Here is will obviously will make everything disappear after the C from 26 C
so if I only would do this command it would be:
Temperature: 75 F (26 C
sed removes everything for or after .*
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/).*//'
26 C
Now to make a script with it, so we can print it out on the display.
nano DIAMoscow
The script I made:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
$DISPL -W 11:0:b
$DISPL -t "Out Temp= "`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/C.*//'` “'C”
sleep 5
done
What I now only did is printing “Out Temp=” before it and “'C' after it.
You can also replace “Out Temp” with “DIAMoscow=” of course or an other place you want to know the temperature from.
When you also have to remove a space you can just press the space bar button several times and after that put the letters, number etc. That you want.
794ac8f8423885d53c77a39a9a47a4aed28c7463
3210
3208
2015-09-21T07:51:33Z
Cartridge1987
2553
/* Temperature Station */
wikitext
text/x-wiki
== BETA! Missing other extra information you can get ==
== Temperature Station ==
First look at outside temperature:
First you need to install:
sudo apt-get install weather-util
you can type:
weather 'your city/country'
Sadly, it mostly will give a result that is saying that it is ambiguous. It will then give you the option to choose one of the results. Example:
weather rotterdam:
Searching via name...
Your search is ambiguous, returning 3 matches:
[ehrd] Rotterdam Airport Zestienhoven, Netherlands
[fips3609363935] Rotterdam town, NY
[fips3663924] Rotterdam CDP, NY
If you choose the first one you have to type the code between the: [ ]
So if I would choose the first one I should type:
weather ehrd
You can also type the full name of the place if you put it in quotation marks:
'Rotterdam town, NY'
That should also work.
The result with searching a station should look like this( some have extra information. ):
Searching via station...
[caching result Rotterdam Airport Zestienhoven, Netherlands]
Current conditions at Rotterdam Airport Zestienhoven, Netherlands (EHRD) 51-57N 004-27E -4M
Last updated Sep 14, 2015 - 05:25 AM EDT / 2015.09.14 0925 UTC
Temperature: 62 F (17 C)
Relative Humidity: 82%
Wind: from the S (170 degrees) at 12 MPH (10 KT) (direction variable)
Sky conditions: overcast
You can also find out which code to type by going to this website:
https://en.wikipedia.org/wiki/International_Civil_Aviation_Organization_airport_code
On the site if you scroll down you can see the beginning code of every country.
Look in which section your country is.
Well you click on the beginning letters. Like for France:
LF
There you can find the full 4 letter code which you than can type in the line.
So if you want to know the weather in avord(France):
LFOA
Than on the site you will get a list of all the place in France who can give the weather.
If it is for yourself try to find a station as close in your environment.
Note:
When I tested it out. I found out that some weather stations aren't supported any more. (and don't update any more )
As you maybe already figured out loading a temperature form a certain country can become a really long wait. Because it has to go trough a big list of stations until it finds the station you are searching for.
You can save your country as name in the system to make it faster.
I will now take the temperature from: Domodedovo International Airport – Moscow
UUDD
Do:
nano ~/.weatherrc
To go to the weather rc
( the title and description can both be random names the other lines shouldn't be changed. You can also remove the description of course, but takes makes it of course . )
[DIAMoscow]
description = Domodedovo International Airport - Moscow
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
After you saved and exit just type:
weather DIAMoscow
And you will get to see the things you wanted to see in a split-second.
Now to get the Temperature visible on your Rb_ui_board. For this I installed lynx, because if I would read it like previous ways it will print it with ignoring the enter in the file.
apt-get install lynx
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
It will directly print the result:
Moscow / Domodedovo, Russia (UUDD) 55-24N 037-54E
Sep 18, 2015 - 09:00 AM EDT / 2015.09.18 1300 UTC
Wind: from the SSW (200 degrees) at 18 MPH (16 KT):0
Visibility: greater than 7 mile(s):0
Temperature: 78 F (26 C)
Dew Point: 50 F (10 C)
Relative Humidity: 36%
Pressure (altimeter): 29.97 in. Hg (1015 hPa)
ob: UUDD 181300Z 20008MPS CAVOK 26/10 Q1015 R88/010095 NOSIG
cycle: 13
| grep Temperature
With grep temperature added you want to get the line, where it is showing the temperature:
Temperature: 78 F (26 C)
| sed -e 's/.*(//' -e 's/ C).*//'
This will remove everything for and after 26
The 2 commands in sed are:
first command is:
-e 's/.*(//'
This command make it happen that it will disappear everything before 26
The result with only this could would then also be:
26 C)
The second command:
-e 's/).*//'
Here is will obviously will make everything disappear after the C from 26 C
so if I only would do this command it would be:
Temperature: 75 F (26 C
sed removes everything for or after .*
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/).*//'
26 C
Now to make a script with it, so we can print it out on the display.
nano DIAMoscow
The script I made:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
$DISPL -W 11:0:b
$DISPL -t "Out Temp= "`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/C.*//'` “'C”
sleep 5
done
What I now only did is printing “Out Temp=” before it and “'C' after it.
You can also replace “Out Temp” with “DIAMoscow=” of course or an other place you want to know the temperature from.
When you also have to remove a space you can just press the space bar button several times and after that put the letters, number etc. That you want.
[[File:OutTempHumi.jpg|500px|thumb|none|In the image I already added the humidity.]]
d1a8576bba862e2c69ec5d7ee417e7ddd326895f
3211
3210
2015-09-21T08:07:04Z
Cartridge1987
2553
/* Temperature Station */
wikitext
text/x-wiki
== BETA! Missing other extra information you can get ==
== Temperature Station ==
First look at outside temperature:
First you need to install:
sudo apt-get install weather-util
you can type:
weather 'your city/country'
Sadly, it mostly will give a result that is saying that it is ambiguous. It will then give you the option to choose one of the results. Example:
weather rotterdam:
Searching via name...
Your search is ambiguous, returning 3 matches:
[ehrd] Rotterdam Airport Zestienhoven, Netherlands
[fips3609363935] Rotterdam town, NY
[fips3663924] Rotterdam CDP, NY
If you choose the first one you have to type the code between the: [ ]
So if I would choose the first one I should type:
weather ehrd
You can also type the full name of the place if you put it in quotation marks:
'Rotterdam town, NY'
That should also work.
The result with searching a station should look like this( some have extra information. ):
Searching via station...
[caching result Rotterdam Airport Zestienhoven, Netherlands]
Current conditions at Rotterdam Airport Zestienhoven, Netherlands (EHRD) 51-57N 004-27E -4M
Last updated Sep 14, 2015 - 05:25 AM EDT / 2015.09.14 0925 UTC
Temperature: 62 F (17 C)
Relative Humidity: 82%
Wind: from the S (170 degrees) at 12 MPH (10 KT) (direction variable)
Sky conditions: overcast
You can also find out which code to type by going to this website:
https://en.wikipedia.org/wiki/International_Civil_Aviation_Organization_airport_code
On the site if you scroll down you can see the beginning code of every country.
Look in which section your country is.
Well you click on the beginning letters. Like for France:
LF
There you can find the full 4 letter code which you than can type in the line.
So if you want to know the weather in avord(France):
LFOA
Than on the site you will get a list of all the place in France who can give the weather.
If it is for yourself try to find a station as close in your environment.
Note:
When I tested it out. I found out that some weather stations aren't supported any more. (and don't update any more )
As you maybe already figured out loading a temperature form a certain country can become a really long wait. Because it has to go trough a big list of stations until it finds the station you are searching for.
You can save your country as name in the system to make it faster.
I will now take the temperature from: Domodedovo International Airport – Moscow
UUDD
Do:
nano ~/.weatherrc
To go to the weather rc
( the title and description can both be random names the other lines shouldn't be changed. You can also remove the description of course, but takes makes it of course . )
[DIAMoscow]
description = Domodedovo International Airport - Moscow
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
After you saved and exit just type:
weather DIAMoscow
And you will get to see the things you wanted to see in a split-second.
Now to get the Temperature visible on your Rb_ui_board. For this I installed lynx, because if I would read it like previous ways it will print it with ignoring the enter in the file.
apt-get install lynx
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
It will directly print the result:
Moscow / Domodedovo, Russia (UUDD) 55-24N 037-54E
Sep 18, 2015 - 09:00 AM EDT / 2015.09.18 1300 UTC
Wind: from the SSW (200 degrees) at 18 MPH (16 KT):0
Visibility: greater than 7 mile(s):0
Temperature: 78 F (26 C)
Dew Point: 50 F (10 C)
Relative Humidity: 36%
Pressure (altimeter): 29.97 in. Hg (1015 hPa)
ob: UUDD 181300Z 20008MPS CAVOK 26/10 Q1015 R88/010095 NOSIG
cycle: 13
| grep Temperature
With grep temperature added you want to get the line, where it is showing the temperature:
Temperature: 78 F (26 C)
| sed -e 's/.*(//' -e 's/ C).*//'
This will remove everything for and after 26
The 2 commands in sed are:
first command is:
-e 's/.*(//'
This command make it happen that it will disappear everything before 26
The result with only this could would then also be:
26 C)
The second command:
-e 's/).*//'
Here is will obviously will make everything disappear after the C from 26 C
so if I only would do this command it would be:
Temperature: 75 F (26 C
sed removes everything for or after .*
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/).*//'
26 C
Now to make a script with it, so we can print it out on the display.
nano DIAMoscow
The script I made:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
$DISPL -W 11:0:b
$DISPL -t "Out Temp= "`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/C.*//'` “'C”
sleep 5
done
What I now only did is printing “Out Temp=” before it and “'C' after it.
You can also replace “Out Temp” with “DIAMoscow=” of course or an other place you want to know the temperature from.
When you also have to remove a space you can just press the space bar button several times and after that put the letters, number etc. That you want.
[[File:OutTempHumi.jpg|500px|thumb|none|In the image I already added the humidity.]]
With adding the Humidity I added these 2 lines in the code:
$DISPL -W 11:20:b
$DISPL -t "Humidity"`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Humidity | sed -e 's/.*://'`
Which prints the code in the second line, And removes everything before ':'.
5c3a1fc5df91e52613d3b1fed7702161672e3d13
3212
3211
2015-09-21T11:45:03Z
Cartridge1987
2553
wikitext
text/x-wiki
== BETA! Missing other extra information you can get ==
== Temperature Station ==
First look at outside temperature:
First you need to install:
sudo apt-get install weather-util
you can type:
weather 'your city/country'
Sadly, it mostly will give a result that is saying that it is ambiguous. It will then give you the option to choose one of the results. Example:
weather rotterdam:
Searching via name...
Your search is ambiguous, returning 3 matches:
[ehrd] Rotterdam Airport Zestienhoven, Netherlands
[fips3609363935] Rotterdam town, NY
[fips3663924] Rotterdam CDP, NY
If you choose the first one you have to type the code between the: [ ]
So if I would choose the first one I should type:
weather ehrd
You can also type the full name of the place if you put it in quotation marks:
'Rotterdam town, NY'
That should also work.
The result with searching a station should look like this( some have extra information. ):
Searching via station...
[caching result Rotterdam Airport Zestienhoven, Netherlands]
Current conditions at Rotterdam Airport Zestienhoven, Netherlands (EHRD) 51-57N 004-27E -4M
Last updated Sep 14, 2015 - 05:25 AM EDT / 2015.09.14 0925 UTC
Temperature: 62 F (17 C)
Relative Humidity: 82%
Wind: from the S (170 degrees) at 12 MPH (10 KT) (direction variable)
Sky conditions: overcast
You can also find out which code to type by going to this website:
https://en.wikipedia.org/wiki/International_Civil_Aviation_Organization_airport_code
On the site if you scroll down you can see the beginning code of every country.
Look in which section your country is.
Well you click on the beginning letters. Like for France:
LF
There you can find the full 4 letter code which you than can type in the line.
So if you want to know the weather in avord(France):
LFOA
Than on the site you will get a list of all the place in France who can give the weather.
If it is for yourself try to find a station as close in your environment.
Note:
When I tested it out. I found out that some weather stations aren't supported any more. (and don't update any more )
As you maybe already figured out loading a temperature form a certain country can become a really long wait. Because it has to go trough a big list of stations until it finds the station you are searching for.
You can save your country as name in the system to make it faster.
I will now take the temperature from: Domodedovo International Airport – Moscow
UUDD
Do:
nano ~/.weatherrc
To go to the weather rc
( the title and description can both be random names the other lines shouldn't be changed. You can also remove the description of course, but takes makes it of course . )
[DIAMoscow]
description = Domodedovo International Airport - Moscow
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
After you saved and exit just type:
weather DIAMoscow
And you will get to see the things you wanted to see in a split-second.
Now to get the Temperature visible on your Rb_ui_board. For this I installed lynx, because if I would read it like previous ways it will print it with ignoring the enter in the file.
apt-get install lynx
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
It will directly print the result:
Moscow / Domodedovo, Russia (UUDD) 55-24N 037-54E
Sep 18, 2015 - 09:00 AM EDT / 2015.09.18 1300 UTC
Wind: from the SSW (200 degrees) at 18 MPH (16 KT):0
Visibility: greater than 7 mile(s):0
Temperature: 78 F (26 C)
Dew Point: 50 F (10 C)
Relative Humidity: 36%
Pressure (altimeter): 29.97 in. Hg (1015 hPa)
ob: UUDD 181300Z 20008MPS CAVOK 26/10 Q1015 R88/010095 NOSIG
cycle: 13
| grep Temperature
With grep temperature added you want to get the line, where it is showing the temperature:
Temperature: 78 F (26 C)
| sed -e 's/.*(//' -e 's/ C).*//'
This will remove everything for and after 26
The 2 commands in sed are:
first command is:
-e 's/.*(//'
This command make it happen that it will disappear everything before 26
The result with only this could would then also be:
26 C)
The second command:
-e 's/).*//'
Here is will obviously will make everything disappear after the C from 26 C
so if I only would do this command it would be:
Temperature: 75 F (26 C
sed removes everything for or after .*
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/).*//'
26 C
Now to make a script with it, so we can print it out on the display.
nano DIAMoscow
The script I made:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
$DISPL -W 11:0:b
$DISPL -t "Out Temp= "`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/C.*//'` “'C”
sleep 5
done
What I now only did is printing “Out Temp=” before it and “'C' after it.
You can also replace “Out Temp” with “DIAMoscow=” of course or an other place you want to know the temperature from.
When you also have to remove a space you can just press the space bar button several times and after that put the letters, number etc. That you want.
[[File:OutTempHumi.jpg|500px|thumb|none|In the image I already added the humidity.]]
With adding the Humidity I added these 2 lines in the code:
$DISPL -W 11:20:b
$DISPL -t "Humidity"`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Humidity | sed -e 's/.*://'`
Which prints the code in the second line, And removes everything before ':'.
== Wind Station ==
For the Wind Station we can for the most part use the same code.
$DISPL -t "Wind" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*the//' -e 's/ degrees.*//'`")"
$DISPL -t "Windspeed" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*at //' -e 's/ MPH.*//'`"MPH"
You probably know by now how it all works. And can get maybe also get other information from the weather station.
The only thing now I want to do is change the windspeed from MPH to KPH. Because we don't use MPH in my country.
1 MPH is around 1.60934 KPH.
(Because I for now didn't found out how to work with comma numbers.)
I will multiply it with 100000, what makes it: 160934.
After that I do the 160934 multiplied the mph result.
I will divide it trough 100000 so it can get to it's real number.
( Note: It always wrap up to the first number so:
16.9 and 16.1 will give the same result wrapped up: 16.)
Final code for MPH -> KPH:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
MPH=$(lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*at //' -e 's/ MPH.*//')
KPH0=$(($MPH * 160934))
KPH1=$(($KPH0 / 100000))
$DISPL -W 11:00:b
$DISPL -t "Wind" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*the//' -e 's/ degrees.*//'`")"
$DISPL -W 11:20:b
$DISPL -t "Windspeed" $KPH1"KPH"
sleep 5
done
( You can also change the text with this code:
This replaces the first word with the second one given.
echo I like chicken meat | sed -e 's/chicken/dog/'
Result:
I like dog meat
)
0ab558d95f748a05102df2832697bc45cf0725da
3215
3212
2015-09-21T11:58:22Z
Cartridge1987
2553
/* Wind Station */
wikitext
text/x-wiki
== BETA! Missing other extra information you can get ==
== Temperature Station ==
First look at outside temperature:
First you need to install:
sudo apt-get install weather-util
you can type:
weather 'your city/country'
Sadly, it mostly will give a result that is saying that it is ambiguous. It will then give you the option to choose one of the results. Example:
weather rotterdam:
Searching via name...
Your search is ambiguous, returning 3 matches:
[ehrd] Rotterdam Airport Zestienhoven, Netherlands
[fips3609363935] Rotterdam town, NY
[fips3663924] Rotterdam CDP, NY
If you choose the first one you have to type the code between the: [ ]
So if I would choose the first one I should type:
weather ehrd
You can also type the full name of the place if you put it in quotation marks:
'Rotterdam town, NY'
That should also work.
The result with searching a station should look like this( some have extra information. ):
Searching via station...
[caching result Rotterdam Airport Zestienhoven, Netherlands]
Current conditions at Rotterdam Airport Zestienhoven, Netherlands (EHRD) 51-57N 004-27E -4M
Last updated Sep 14, 2015 - 05:25 AM EDT / 2015.09.14 0925 UTC
Temperature: 62 F (17 C)
Relative Humidity: 82%
Wind: from the S (170 degrees) at 12 MPH (10 KT) (direction variable)
Sky conditions: overcast
You can also find out which code to type by going to this website:
https://en.wikipedia.org/wiki/International_Civil_Aviation_Organization_airport_code
On the site if you scroll down you can see the beginning code of every country.
Look in which section your country is.
Well you click on the beginning letters. Like for France:
LF
There you can find the full 4 letter code which you than can type in the line.
So if you want to know the weather in avord(France):
LFOA
Than on the site you will get a list of all the place in France who can give the weather.
If it is for yourself try to find a station as close in your environment.
Note:
When I tested it out. I found out that some weather stations aren't supported any more. (and don't update any more )
As you maybe already figured out loading a temperature form a certain country can become a really long wait. Because it has to go trough a big list of stations until it finds the station you are searching for.
You can save your country as name in the system to make it faster.
I will now take the temperature from: Domodedovo International Airport – Moscow
UUDD
Do:
nano ~/.weatherrc
To go to the weather rc
( the title and description can both be random names the other lines shouldn't be changed. You can also remove the description of course, but takes makes it of course . )
[DIAMoscow]
description = Domodedovo International Airport - Moscow
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
After you saved and exit just type:
weather DIAMoscow
And you will get to see the things you wanted to see in a split-second.
Now to get the Temperature visible on your Rb_ui_board. For this I installed lynx, because if I would read it like previous ways it will print it with ignoring the enter in the file.
apt-get install lynx
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
It will directly print the result:
Moscow / Domodedovo, Russia (UUDD) 55-24N 037-54E
Sep 18, 2015 - 09:00 AM EDT / 2015.09.18 1300 UTC
Wind: from the SSW (200 degrees) at 18 MPH (16 KT):0
Visibility: greater than 7 mile(s):0
Temperature: 78 F (26 C)
Dew Point: 50 F (10 C)
Relative Humidity: 36%
Pressure (altimeter): 29.97 in. Hg (1015 hPa)
ob: UUDD 181300Z 20008MPS CAVOK 26/10 Q1015 R88/010095 NOSIG
cycle: 13
| grep Temperature
With grep temperature added you want to get the line, where it is showing the temperature:
Temperature: 78 F (26 C)
| sed -e 's/.*(//' -e 's/ C).*//'
This will remove everything for and after 26
The 2 commands in sed are:
first command is:
-e 's/.*(//'
This command make it happen that it will disappear everything before 26
The result with only this could would then also be:
26 C)
The second command:
-e 's/).*//'
Here is will obviously will make everything disappear after the C from 26 C
so if I only would do this command it would be:
Temperature: 75 F (26 C
sed removes everything for or after .*
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/).*//'
26 C
Now to make a script with it, so we can print it out on the display.
nano DIAMoscow
The script I made:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
$DISPL -W 11:0:b
$DISPL -t "Out Temp= "`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/C.*//'` “'C”
sleep 5
done
What I now only did is printing “Out Temp=” before it and “'C' after it.
You can also replace “Out Temp” with “DIAMoscow=” of course or an other place you want to know the temperature from.
When you also have to remove a space you can just press the space bar button several times and after that put the letters, number etc. That you want.
[[File:OutTempHumi.jpg|500px|thumb|none|In the image I already added the humidity.]]
With adding the Humidity I added these 2 lines in the code:
$DISPL -W 11:20:b
$DISPL -t "Humidity"`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Humidity | sed -e 's/.*://'`
Which prints the code in the second line, And removes everything before ':'.
== Wind Station ==
For the Wind Station we can for the most part use the same code.
$DISPL -t "Wind" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*the//' -e 's/ degrees.*//'`")"
$DISPL -t "Windspeed" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*at //' -e 's/ MPH.*//'`"MPH"
You probably know by now how it all works. And can get maybe also get other information from the weather station.
The only thing now I want to do is change the windspeed from MPH to KPH. Because we don't use MPH in my country.
[[File:MPH.jpg|400px|thumb|none|]]
1 MPH is around 1.60934 KPH.
(Because I for now didn't found out how to work with comma numbers.)
I will multiply it with 100000, what makes it: 160934.
After that I do the 160934 multiplied the mph result.
I will divide it trough 100000 so it can get to it's real number.
( Note: It always wrap up to the first number so:
16.9 and 16.1 will give the same result wrapped up: 16.)
Final code for MPH -> KPH:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
MPH=$(lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*at //' -e 's/ MPH.*//')
KPH0=$(($MPH * 160934))
KPH1=$(($KPH0 / 100000))
$DISPL -W 11:00:b
$DISPL -t "Wind" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*the//' -e 's/ degrees.*//'`")"
$DISPL -W 11:20:b
$DISPL -t "Windspeed" $KPH1"KPH"
sleep 5
done
( You can also change the text with this code:
This replaces the first word with the second one given.
echo I like chicken meat | sed -e 's/chicken/dog/'
Result:
I like dog meat
)
[[File:KPH.jpg|400px|thumb|none|]]
716c3f18588072bb2916f3d0c1d6936000629d64
3216
3215
2015-09-21T11:58:52Z
Cartridge1987
2553
/* Wind Station */
wikitext
text/x-wiki
== BETA! Missing other extra information you can get ==
== Temperature Station ==
First look at outside temperature:
First you need to install:
sudo apt-get install weather-util
you can type:
weather 'your city/country'
Sadly, it mostly will give a result that is saying that it is ambiguous. It will then give you the option to choose one of the results. Example:
weather rotterdam:
Searching via name...
Your search is ambiguous, returning 3 matches:
[ehrd] Rotterdam Airport Zestienhoven, Netherlands
[fips3609363935] Rotterdam town, NY
[fips3663924] Rotterdam CDP, NY
If you choose the first one you have to type the code between the: [ ]
So if I would choose the first one I should type:
weather ehrd
You can also type the full name of the place if you put it in quotation marks:
'Rotterdam town, NY'
That should also work.
The result with searching a station should look like this( some have extra information. ):
Searching via station...
[caching result Rotterdam Airport Zestienhoven, Netherlands]
Current conditions at Rotterdam Airport Zestienhoven, Netherlands (EHRD) 51-57N 004-27E -4M
Last updated Sep 14, 2015 - 05:25 AM EDT / 2015.09.14 0925 UTC
Temperature: 62 F (17 C)
Relative Humidity: 82%
Wind: from the S (170 degrees) at 12 MPH (10 KT) (direction variable)
Sky conditions: overcast
You can also find out which code to type by going to this website:
https://en.wikipedia.org/wiki/International_Civil_Aviation_Organization_airport_code
On the site if you scroll down you can see the beginning code of every country.
Look in which section your country is.
Well you click on the beginning letters. Like for France:
LF
There you can find the full 4 letter code which you than can type in the line.
So if you want to know the weather in avord(France):
LFOA
Than on the site you will get a list of all the place in France who can give the weather.
If it is for yourself try to find a station as close in your environment.
Note:
When I tested it out. I found out that some weather stations aren't supported any more. (and don't update any more )
As you maybe already figured out loading a temperature form a certain country can become a really long wait. Because it has to go trough a big list of stations until it finds the station you are searching for.
You can save your country as name in the system to make it faster.
I will now take the temperature from: Domodedovo International Airport – Moscow
UUDD
Do:
nano ~/.weatherrc
To go to the weather rc
( the title and description can both be random names the other lines shouldn't be changed. You can also remove the description of course, but takes makes it of course . )
[DIAMoscow]
description = Domodedovo International Airport - Moscow
metar = http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
After you saved and exit just type:
weather DIAMoscow
And you will get to see the things you wanted to see in a split-second.
Now to get the Temperature visible on your Rb_ui_board. For this I installed lynx, because if I would read it like previous ways it will print it with ignoring the enter in the file.
apt-get install lynx
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT
It will directly print the result:
Moscow / Domodedovo, Russia (UUDD) 55-24N 037-54E
Sep 18, 2015 - 09:00 AM EDT / 2015.09.18 1300 UTC
Wind: from the SSW (200 degrees) at 18 MPH (16 KT):0
Visibility: greater than 7 mile(s):0
Temperature: 78 F (26 C)
Dew Point: 50 F (10 C)
Relative Humidity: 36%
Pressure (altimeter): 29.97 in. Hg (1015 hPa)
ob: UUDD 181300Z 20008MPS CAVOK 26/10 Q1015 R88/010095 NOSIG
cycle: 13
| grep Temperature
With grep temperature added you want to get the line, where it is showing the temperature:
Temperature: 78 F (26 C)
| sed -e 's/.*(//' -e 's/ C).*//'
This will remove everything for and after 26
The 2 commands in sed are:
first command is:
-e 's/.*(//'
This command make it happen that it will disappear everything before 26
The result with only this could would then also be:
26 C)
The second command:
-e 's/).*//'
Here is will obviously will make everything disappear after the C from 26 C
so if I only would do this command it would be:
Temperature: 75 F (26 C
sed removes everything for or after .*
lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/).*//'
26 C
Now to make a script with it, so we can print it out on the display.
nano DIAMoscow
The script I made:
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
$DISPL -W 11:0:b
$DISPL -t "Out Temp= "`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Temperature | sed -e 's/.*(//' -e 's/C.*//'` “'C”
sleep 5
done
What I now only did is printing “Out Temp=” before it and “'C' after it.
You can also replace “Out Temp” with “DIAMoscow=” of course or an other place you want to know the temperature from.
When you also have to remove a space you can just press the space bar button several times and after that put the letters, number etc. That you want.
[[File:OutTempHumi.jpg|500px|thumb|none|In the image I already added the humidity.]]
With adding the Humidity I added these 2 lines in the code:
$DISPL -W 11:20:b
$DISPL -t "Humidity"`lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Humidity | sed -e 's/.*://'`
Which prints the code in the second line, And removes everything before ':'.
== Wind Station ==
For the Wind Station we can for the most part use the same code.
$DISPL -t "Wind" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*the//' -e 's/ degrees.*//'`")"
$DISPL -t "Windspeed" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*at //' -e 's/ MPH.*//'`"MPH"
You probably know by now how it all works. And can get maybe also get other information from the weather station.
The only thing now I want to do is change the windspeed from MPH to KPH. Because we don't use MPH in my country.
[[File:MPH.jpg|400px|thumb|none|]]
1 MPH is around 1.60934 KPH.
(Because I for now didn't found out how to work with comma numbers.)
I will multiply it with 100000, what makes it: 160934.
After that I do the 160934 multiplied the mph result.
I will divide it trough 100000 so it can get to it's real number.
( Note: It always wrap up to the first number so:
16.9 and 16.1 will give the same result wrapped up: 16.)
Final code for MPH -> KPH:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
$DISPL -W 10:0:b
while true; do
MPH=$(lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*at //' -e 's/ MPH.*//')
KPH0=$(($MPH * 160934))
KPH1=$(($KPH0 / 100000))
$DISPL -W 11:00:b
$DISPL -t "Wind" `lynx -dump http://weather.noaa.gov/pub/data/observations/metar/decoded/UUDD.TXT | grep Wind | sed -e 's/.*the//' -e 's/ degrees.*//'`")"
$DISPL -W 11:20:b
$DISPL -t "Windspeed" $KPH1"KPH"
sleep 5
done
( You can also change the text with this code:
This replaces the first word with the second one given.
echo I like chicken meat | sed -e 's/chicken/dog/'
Result:
I like dog meat
)
[[File:KPH.jpg|400px|thumb|none|]]
5c320dd4b6dd385eb65107e22a1dd143240a2c9e
File:OutTempHumi.jpg
6
1802
3209
2015-09-21T07:39:11Z
Cartridge1987
2553
This image shows the outside Temperature and humidity from a airport in Moscow displayed on a RPi_UI board.
wikitext
text/x-wiki
This image shows the outside Temperature and humidity from a airport in Moscow displayed on a RPi_UI board.
e875a6243938c0e9d27118e6e7621a8de1357eb9
File:MPH.jpg
6
1803
3213
2015-09-21T11:54:25Z
Cartridge1987
2553
Displays the information from a weather station.
Shows where the wind comes from and on which speed. (MPH)
wikitext
text/x-wiki
Displays the information from a weather station.
Shows where the wind comes from and on which speed. (MPH)
12f376768207404dfcdbe810d5362c819d09310e
File:KPH.jpg
6
1804
3214
2015-09-21T11:55:21Z
Cartridge1987
2553
Displays the information from a weather station.
It shows from which side the wind comes from and on which speed.
wikitext
text/x-wiki
Displays the information from a weather station.
It shows from which side the wind comes from and on which speed.
ab4fc48a02e95b20a95be8ffd548e6da5fe838da
Blog 02
0
1785
3225
3168
2015-09-22T08:08:47Z
Cartridge1987
2553
wikitext
text/x-wiki
Hello,
This is my first project with the Raspberry Pi. In this [[Blog list]] I will keep you posted about my Raspberry Pi projects.
In this project I want to turn on and off a lamp with a Raspberry Relay. After I figured this out, I want to do more useful things with the Raspberry Relay and the lamp.
Before I connect the cables I want to know, where I have to put what were.
Or in other words where in the pin-outs do I have to put the cables from the power supply and the lamp itself.
On the wikipedia page from the Relay I found out that the power supply has to be on pin 9 and 10.
On pin 10 has to come the (+)blue cable and on pin 9 the (-)brown cable.
[[File:Powerconnect.jpg|400px|thumb|none|]]
To find out where the (+)blue cable and (-)brown cable has to go at the relay. I first checked the relay with a multimeter with give the result same as on the site, that the left side is off and the right side is the relay activated. To know what is left and what is right: On the right side there is a small circle.
With this result I know that pin 1( or 3, 5 and 7) is where the (+)blue cable has to be putt in and other pin 2( or 4, 6, 8 ) I have to put the (-)brown cable.
[[File:Dsc05969_small_smallTSE.jpg|400px|thumb|none|]]
*For getting the (+) and (-) cable I have to cut the cables and remove the rubber shell.
*Check if the cables are really well stuck in the pin-outs. ( By pulling the cables. )
Before putting the Raspberry Relay on the Raspberry Pi:
I want to protect the bottom protrusions, with 2 times tape on them so that they don't get trough it.
The main reason I do this is because the Raspberry Relay will get 230 volt on it if it will get in contact with the Raspberry Pi, this could give fatal results.
[[File:Tapeonrelay.jpg|400px|thumb|none|]]
Now I got all the cables connected I want to be sure my power supply is turned off. ( So that I don't get a shock of 230 volt! ) Now I can put it on my Raspberry Pi.
When the Raspberry Relay is on the Raspberry Pi you can see a green led on that shows that it is getting power.
Now everything is physical ready ( except the power supply ) we can start the programming.
First I had to download WiringPi, that sees the pins.
Sudo apt-get install git-core
To get the application to download WiringPi.
git clone git://git.drogon.net/wiringPi
To then download WiringPi with the application.
When downloaded I wanted to know if I had all files and all the updates.
cd wiringPi
git pull origin
To make it work type:
./build
First we have to make all the relay outputs. We do that with the code:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
To check if the all the relays work we have to activate them all separate. So every code line has to get it's own turn.
gpio write 0 1
gpio write 1 1
gpio write 2 1
gpio write 3 1
At every line of the code you will hear a loud click sound. All the relays for me worked except the third one. The reason the third relay didn't work was because there was not led + mosfet soldered.
After that I knew which relays worked and didn't. I turned them all off:
gpio write 0 0
gpio write 1 0
gpio write 2 0
gpio write 3 0
When all the relays were off, I could finally turn on the power supply:
gpio write 0 1
and ta da! I burned my eyes!
[[File:ConnectionLampOn.jpg|400px|thumb|none|]]
The End
ba33ef2781e6fa3ce0d75a596c86eb6c5e7f786d
Blog 10
0
1806
3228
2015-09-24T11:18:18Z
Cartridge1987
2553
Created page with " == Push menu == 1. Temperature (From [[blog 05]]) 2. Time with load averages (From [[blog 04]]) 3. CPU + GPU (From [[blog 08]]) 4. Temperature at weather station (From ..."
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
Print=showtemp2
Print=time_load
Print=DIAMoscow2
Print=cgpu2
Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
# kijk naar de knoppen
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=showtemp2
fi
if [ $Button = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=time_load
fi
if [ $Button = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=cgpu2
fi
if [ $Button = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMWind
fi
if [ $Button = "01" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
It directly removes everything from display. (10:00)
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
0d975382cd3e4d6025ceb718080bdfd5b0650343
3229
3228
2015-09-24T11:37:22Z
Cartridge1987
2553
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
# kijk naar de knoppen
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=showtemp2
fi
if [ $Button = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=time_load
fi
if [ $Button = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=cgpu2
fi
if [ $Button = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMWind
fi
if [ $Button = "01" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
It directly removes everything from display. (10:00)
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
de0fec4c4f1b02d1e78c0cb50c697925dfa5e1a1
3230
3229
2015-09-24T11:50:14Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
# kijk naar de knoppen
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=showtemp2
fi
if [ $Button = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=time_load
fi
if [ $Button = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=cgpu2
fi
if [ $Button = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMWind
fi
if [ $Button = "01" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
54fcd197956bef210e05c29ab77bc300a4755f50
3231
3230
2015-09-24T11:52:05Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example:
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
# kijk naar de knoppen
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=showtemp2
fi
if [ $Button = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=time_load
fi
if [ $Button = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=cgpu2
fi
if [ $Button = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=DIAMWind
fi
if [ $Button = "01" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
1305a09e536fe791d367d7c487cd0a60f45c9180
3232
3231
2015-09-24T12:26:28Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example:
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
# kijk naar de knoppen
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
a1daba34ed7a6786861802d5d7a8b5975ced5667
3233
3232
2015-09-24T12:27:00Z
Cartridge1987
2553
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example:
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
# kijk naar de knoppen
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
d046b39640c12dda415e9ac5aee0d2aafb2fcd49
3234
3233
2015-09-24T12:28:56Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example:
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
5806a38eeb5f0ca823f116fa3315c018003d46da
3235
3234
2015-09-24T12:42:47Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
I used previous codes, but I copied them in a new version.
Example:
cp timer > time_load
You have to make the script get to the basic, so that it only prints.
So things like this has to be removed:
while true
done
echo
10:00/11:00
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU +GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
5398eb6f8e5a3e3a8cadb07c2354b014c3f95608
3236
3235
2015-09-24T13:17:23Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu that is controlled with pushbutton from the Rp_UI_display.
So, I can show the information from the script and use the pushbuttons to control it.
I still modified the previous codes, but I copied them in a new version.
Example:
cp timer > time_load
I had to make the script to get to the basics, so that it only prints the information.
So things like this has to be removed:
while true
done
echo
10:00/11:00
sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
a7a92c284aab8ba897d0c71907d3e0ffa0896f0b
3237
3236
2015-09-24T13:25:54Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu that is controlled with pushbutton from the Rp_UI_display.
So, I can show the information from the script and use the pushbuttons to control it.
I still modified the previous codes, but I copied them in a new version.
Example:
cp timer > time_load
I had to make the script to get to the basics, so that it only prints the information.
So things like this has to be removed:
while true
done
echo
10:00/11:00
sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
de2ee912fe77c062b3e4702e2a514e795c0cb3e4
3238
3237
2015-09-24T14:04:56Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu that is controlled with pushbutton from the RPi_UI board.
So, I can show the information from the script and use the pushbuttons to control it.
I still modified the previous codes, but I copied them in a new version.
Example:
cp timer > time_load
I had to make the script to get to the basics, so that it only prints the information.
So things like this has to be removed:
while true
done
echo
10:00/11:00
sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages':
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
c2b8e47579dd870c225f586c693fb10df094d51c
3239
3238
2015-09-24T14:24:43Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
while true
done
echo
10:00/11:00
sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the final script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
891e446f884623ffccf0620439a410a4e7cf0ac6
3240
3239
2015-09-24T14:30:59Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
while true; do
done
echo
10:00/11:00
sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the final script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
sleep 1
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
1b4291e86d77b24a8976cec65c381c8a936ebc0d
3241
3240
2015-09-24T14:31:45Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
while true; do
done
echo
10:00/11:00
sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the final script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
sleep 1
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
f5ef8ee73d5ef1f9d9f414a6aaf51017051c6eea
3242
3241
2015-09-24T14:32:50Z
Cartridge1987
2553
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
while true; do
done
echo
10:00/11:00
sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the final script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
sleep 1
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
18fc8092de3abf14e60b36e2645c469d35090d5a
3243
3242
2015-09-24T14:38:20Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
1. Temperature (From [[blog 05]])
2. Time with load averages (From [[blog 04]])
3. CPU + GPU (From [[blog 08]])
4. Temperature at weather station (From [[blog 09]])
5. Wind a weather station (From [[blog 09]])
6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the final script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
1. Temperature
2. Time
3. CPU + GPU
4. Temperature at weather station
5. Wind at weather station
6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
sleep 1
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
5eb39bebc4430e1d2c96bb99f12b8e6305c0379e
3244
3243
2015-09-24T14:39:47Z
Cartridge1987
2553
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the final script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
At the end it says it has to place on the line 11:00 ( If you remove that part, it paste the text without the previous one, while refreshing.)
and with ./$print he that finally print the every second the one information from the button pressed.
sleep 1
Thanks to the sleep you now have to wait a second to recognize the different button you pressed. Because it has to go trough that list again in that 1 sec.
I hope this can also be useful for your own use.
a2a1e7acf1860393470f371fbc6439e80b33c89a
3245
3244
2015-09-24T14:47:27Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to to also remove the second line. It only cleans first row with 11:00.
Example from the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the final script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list can delete the and only turn on 1 of them.
If you remove it, it wouldn't be a problem on the display but a error.
I found out this later, but left the others there because I thought maybe some people would like to start with an other one.
It directly removes everything from display. (10:00)
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00 and then it will be just refresh the last one.
When pressed it will directly remove the previous text. Because at the beginning it wil if not 00 is pressed with !=. So, it will directly remove the previous text when pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it will start the while loop. ( while true; do)
When started it will first look if it detects which button is pressed.
After that I made 6 if statements to check of that button is pressed.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
Press the number you want to know and press the button.
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then finally prints every second the information from the button pressed that was last pressed.
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
3c41c9853eb8b2c51f69b918cc8a76f48bba67e8
3246
3245
2015-09-24T15:08:38Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to also remove the second line. It only cleans first row with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it says Print=Showtemp2.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then finally prints every second the information from the button pressed that was last pressed. So it would then print out the information from showtemp2.
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
81735be1552b15a5794f8a4766b82fa779ddeb76
3247
3246
2015-09-24T15:09:08Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to also remove the second line. It only cleans first row with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it says Print=Showtemp2.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then finally prints every second the information from the button pressed that was last pressed. So it would then print out the information from showtemp2.
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
1c23185726af0e3696d0e31602c07ce592073d11
3248
3247
2015-09-24T15:13:02Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from the script on the display and use the pushbuttons to control it.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to also remove the second line. It only cleans first row with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it makes Print Showtemp2.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from showtemp2. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
b7025ca395e6d4973d0a5a2f96a834de41f49948
3249
3248
2015-09-24T15:14:45Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from one of the six scripts on the display and use the pushbuttons to choose which one I want to see.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to also remove the second line. It only cleans first row with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it makes Print Showtemp2.
( to detect which button gives which number:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from showtemp2. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
2ae866fb2d9fc3674bd8daef94e1f2c2a25f1117
3250
3249
2015-09-25T07:38:50Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from one of the six scripts on the display and use the pushbuttons to choose which one I want to see.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer > time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to also remove the second line. It only cleans first row with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it makes Print Showtemp2.
( to detect which button gives which number. You have to copy paste this line and press the button you want to know:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from showtemp2. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
19a396603392ccc9df0b8bd32d3a7b8ee90e3138
Blog list
0
1798
3251
3217
2015-09-25T07:50:10Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
*[[Blog 01]] - Starting up the Raspberry Pi
*[[Blog 02]] - Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - Online weather station
*[[Blog 10]] - Pushbutton menu
c36384f421e5e4bbfc0961f88e888c298995152c
Blog 11
0
1807
3252
2015-09-25T08:12:30Z
Cartridge1987
2553
Created page with " == CHARLEY BETA! == == Clock based On/off system == My new system I am going to make is a system that on special times turns light on or off. I want to use this as some a..."
wikitext
text/x-wiki
== CHARLEY BETA! ==
== Clock based On/off system ==
My new system I am going to make is a system that on special times turns light on or off.
I want to use this as some anti-criminal system. So, that when I am on vacation still the lights are on at night or day. So the house doesn't look like a house that is asking for crackers or criminals.
For this system I am of course going to try it with shorter times otherwise I have to wait 8 hours for a lamp to get on or off.
So when I start the code I plan it 1 minute in the future.
I already made a lamp go on and off in [[blog 02]]. so I am going to use that same technique for turning on and of the lamp.
Crontab is more manually
Crontab -e
has to be done to open
and have to put this in to make it work
# mm hh dom mon dow command
19 13 * * * /usr/local/bin/gpio write 3 1
20 13 * * * /usr/local/bin/gpio write 3 0
To read a certain part:
crontab -l |grep -v bin/gpio
For the people who don't understand:
*1 Minute 0-59
*2 Hour 0-23 (0 = midnight)
*3 Day 1-31
*4 Month 1-12
*5 Weekday 0-6 (0 = Sunday)
So the text from my is now saying:
gpio write 3 1 at 13:19
gpio write 3 0 at 13:20
( echo "# mm hh dom mon dow command" ; echo '19 13 * * * /usr/local/bin/gpio write 3 1' ; echo '20 13 * * * /usr/local/bin/gpio write 3 0' ) | crontab
( You can of course also use it as alarm clock, then you only have to change the command to the location of the audio file you want to play.)
== manual Display Alarm ==
b12e541f64f4b45232ddb48f8a2146da31def801
3253
3252
2015-09-25T09:32:07Z
Cartridge1987
2553
/* Clock based On/off system */
wikitext
text/x-wiki
== CHARLEY BETA! ==
== Clock based On/off system ==
My new system I am going to make is a system that on special times turns light on or off.
I want to use this as some anti-criminal system. So, that when I am away the lights are still on at night or day in the house. So the house doesn't look like a house that is asking for crackers or criminals.
For this system I am of course going to try it with shorter times otherwise I have to wait 8 hours for a lamp to get on or off.
So when I start the code I plan it 1 minute in the future.
I already made a lamp go on and off in [[blog 02]]. So I am going to use that same technique for turning on and off the lamp.
Crontab is more manually
Crontab -e
has to be done to open
and have to put this in to make it work
# mm hh dom mon dow command
19 13 * * * /usr/local/bin/gpio write 3 1
20 13 * * * /usr/local/bin/gpio write 3 0
To read a certain part:
crontab -l |grep -v bin/gpio
For the people who don't understand:
*1 Minute 0-59
*2 Hour 0-23 (0 = midnight)
*3 Day 1-31
*4 Month 1-12
*5 Weekday 0-6 (0 = Sunday)
So the text from my is now saying:
gpio write 3 1 at 13:19
gpio write 3 0 at 13:20
( echo "# mm hh dom mon dow command" ; echo '19 13 * * * /usr/local/bin/gpio write 3 1' ; echo '20 13 * * * /usr/local/bin/gpio write 3 0' ) | crontab
( You can of course also use it as alarm clock, then you only have to change the command to the location of the audio file you want to play.)
== manual Display Alarm ==
628584ae2fc9cf90afa7f736b67b83ba5931f9a2
3254
3253
2015-09-25T09:32:42Z
Cartridge1987
2553
/* Clock based On/off system */
wikitext
text/x-wiki
== CHARLEY BETA! ==
== Clock based On/off system ==
My new system I am going to make is a system that on special times turns light on or off.
I want to use this as some anti-criminal system. So, that when I am away the lights are still on at night or day in the house. So the house doesn't look like a house that is asking for crackers or criminals.
For this system I am of course going to try it with shorter times otherwise I have to wait 8 hours for a lamp to get on or off.
So when I start the code I plan it 1 minute in the future.
I already made a lamp go on and off in [[blog 02]]. So I am going to use that same technique for turning on and off the lamp.
Crontab is more manually
crontab -e
has to be done to open
and have to put this in to make it work
# mm hh dom mon dow command
19 13 * * * /usr/local/bin/gpio write 3 1
20 13 * * * /usr/local/bin/gpio write 3 0
To read a certain part:
crontab -l |grep -v bin/gpio
For the people who don't understand:
*1 Minute 0-59
*2 Hour 0-23 (0 = midnight)
*3 Day 1-31
*4 Month 1-12
*5 Weekday 0-6 (0 = Sunday)
So the text from my is now saying:
gpio write 3 1 at 13:19
gpio write 3 0 at 13:20
( echo "# mm hh dom mon dow command" ; echo '19 13 * * * /usr/local/bin/gpio write 3 1' ; echo '20 13 * * * /usr/local/bin/gpio write 3 0' ) | crontab
( You can of course also use it as alarm clock, then you only have to change the command to the location of the audio file you want to play.)
== manual Display Alarm ==
6c347b8ef56569f1db5718bee02c8d61aedf131c
3255
3254
2015-09-25T09:42:13Z
Cartridge1987
2553
/* Clock based On/off system */
wikitext
text/x-wiki
== CHARLEY BETA! ==
== Clock based On/off system ==
My new system I am going to make is a system that on special times turns light on or off.
I want to use this as some anti-criminal system. So, that when I am away the lights are still on at night or day in the house. So the house doesn't look like a house that is asking for crackers or criminals.
For this system I am of course going to try it with shorter times otherwise I have to wait 8 hours for a lamp to get on or off.
So when I start the code I plan it 1 minute in the future.
I already made a lamp go on and off in [[blog 02]]. So I am going to use that same set-up for turning on and off the lamp.
Crontab is more manually
crontab -e
has to be done to open
and have to put this in to make it work:
# mm hh dom mon dow command
19 13 * * * /usr/local/bin/gpio write 3 1
20 13 * * * /usr/local/bin/gpio write 3 0
To read a certain part:
crontab -l |grep bin/gpio
( with -v you can also the other parts with out bin/gpio appearing.
For the people who don't understand:
*1 (mm)Minute 0-59
*2 (hh)Hour 0-23 (0 = midnight)
*3 (dom)Day 1-31
*4 (mon)Month 1-12
*5 (dow)Weekday 0-6 (0 = Sunday)
So the text from my is now saying:
gpio write 3 1 at 13:19
gpio write 3 0 at 13:20
To manually change it in the command line:
( echo "# mm hh dom mon dow command" ; echo '19 13 * * * /usr/local/bin/gpio write 3 1' ; echo '20 13 * * * /usr/local/bin/gpio write 3 0' ) | crontab
( You can of course also use it as alarm clock, then you only have to change the command to the location of the audio file you want to play.)
== manual Display Alarm ==
a88c89aeb5a3e85be6b96cc5014d9c89471d92d9
Blog 12
0
1808
3256
2015-10-07T09:32:25Z
Cartridge1987
2553
Created page with "== BETA! == Alarm This time I am going to make an Alarm. For this I will use: *Rp_ui_board *3pin earplugs ( I didn't have a speaker ) I want to make it possible that you ..."
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
AlarmMenu
Main menu where you can select the scripts
TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
AcTime(Button 6)
This will put the given hour and or minute in the crontab.
StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How does my alarm work?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)" "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
==Script StopSong==
#!/bin/bash
killall mplayer
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
5ad515f2eafb0c4d17ce41380eb6b847e7825243
3257
3256
2015-10-07T09:46:26Z
Cartridge1987
2553
/* BETA! */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How does my alarm work?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)" "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
==Script StopSong==
#!/bin/bash
killall mplayer
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
9af4f01aec7da0a4c758ec8b2c30892bf0a441cf
3258
3257
2015-10-07T09:48:35Z
Cartridge1987
2553
/* BETA! */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)" "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
==Script StopSong==
#!/bin/bash
killall mplayer
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
99d7ff048bf581c1dbb0b9375d433c622792aa09
3259
3258
2015-10-07T09:49:34Z
Cartridge1987
2553
/* Scripts AlarmMenu */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)" "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
==Script StopSong==
#!/bin/bash
killall mplayer
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
8f998a237cea4a12578ce5ced6133f29075898bc
3260
3259
2015-10-07T10:30:48Z
Cartridge1987
2553
/* Script Crontime3 */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
==Script StopSong==
#!/bin/bash
killall mplayer
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
43f07a3a5ece1bc3bd8937ffaa37831ba8b4daa8
3261
3260
2015-10-07T10:58:48Z
Cartridge1987
2553
/* Script AcTime */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
e11309627d0ccf3b834c6befcb565730463b06f1
3262
3261
2015-10-07T11:00:26Z
Cartridge1987
2553
/* Script StopSong */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
a657c50d0fd8270bab6ec89f262001826b1cc069
3263
3262
2015-10-07T11:05:41Z
Cartridge1987
2553
/* Script ResetAlarm */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
475341a81db2c111994f70661d4bc5ad5c4e47e2
3264
3263
2015-10-07T11:10:20Z
Cartridge1987
2553
/* Script Crontime3 */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeTSE
#BUTTON=Crontime3
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=Crontime3
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeTSE
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeTSE ==
This works the same as Crontime3, only the TimeOnhh is changed to TimeOnmm
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
0788e27846db89a051cc8b1984b5ef716d0d4715
3265
3264
2015-10-07T11:11:03Z
Cartridge1987
2553
/* Scripts AlarmMenu */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeTSE ==
This works the same as Crontime3, only the TimeOnhh is changed to TimeOnmm
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
5f0252ea1da01a3fed9e6159a2cbf5695584e6f5
3266
3265
2015-10-07T11:47:10Z
Cartridge1987
2553
/* Script TimeAndAlarm */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeTSE ==
This works the same as Crontime3, only the TimeOnhh is changed to TimeOnmm
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
7971a66b06972c66c329adcf49d617f3e1706900
3267
3266
2015-10-07T11:49:11Z
Cartridge1987
2553
/* CrontimeTSE */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeTSE ==
This works the same as Crontime3, only
TimeOnhh is changed to TimeOnmm & Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
4c22098c5300fd06abae9bf1cd35fa4b515d6485
3268
3267
2015-10-07T11:50:00Z
Cartridge1987
2553
/* Script TimeAndAlarm */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script Crontime3==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeTSE ==
This works the same as Crontime3, only
TimeOnhh is changed to TimeOnmm & Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
71878703b58f69650457dd2159a686ae6c05e4b2
3269
3268
2015-10-07T11:58:14Z
Cartridge1987
2553
/* Script Crontime3 */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeTSE ==
This works the same as Crontime3, only
TimeOnhh is changed to TimeOnmm & Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
614af94010729687bd9d71fbb5d4c8f88487a6cd
3270
3269
2015-10-07T11:58:38Z
Cartridge1987
2553
/* CrontimeTSE */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeMM ==
This works the same as Crontime3, only
TimeOnhh is changed to TimeOnmm & Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
975a37978e39874e53a2f5e2fd21ef04eac74c36
3271
3270
2015-10-07T11:59:28Z
Cartridge1987
2553
/* CrontimeMM */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
831b6bbdcbcd4bcab5642ca37ca76f67415eba04
3272
3271
2015-10-07T12:06:48Z
Cartridge1987
2553
/* Scripts AlarmMenu */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
7fcb1358fe3dcd32e31e2bb4a90b5e358f17b532
3273
3272
2015-10-07T12:07:47Z
Cartridge1987
2553
/* Script ResetAlarm */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
35bb0504621a1b62a5770320bd8a787eaed6d5d8
3274
3273
2015-10-07T12:08:04Z
Cartridge1987
2553
/* Script AcTime */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
07ec9614c6a4da7b07228c6cd35c4cf3faf480ce
3275
3274
2015-10-07T12:36:09Z
Cartridge1987
2553
/* Script CrontimeHH */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
3f5c1b8de1cb258adebfe4f86e33bb0bf4dd0915
3276
3275
2015-10-07T12:37:25Z
Cartridge1987
2553
/* Script CrontimeHH */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
b9a1f93520bf10aa103655ed07002a62b0b7701a
DIO protocol
0
432
3277
3109
2015-10-12T13:28:56Z
Rew
3
/* Using the digital ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
9e7285cb0df6aa0cfa7901e1b6cc1df6afa5d6f1
Blog 13
0
1809
3278
2015-10-13T08:38:48Z
Cartridge1987
2553
Created page with " == Scroll Menu == #!/bin/bash bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00 while true; do HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b` array=( pushmenu2 AlarmMenu Jaap..."
wikitext
text/x-wiki
== Scroll Menu ==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Barray=( "Temp Menu" "Alarm Menu" Radio "Board Settings" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
if [ $HENK = "08" ]; then
Number=0
fi
if [ $HENK = "04" ]; then
Number=10
fi
if [ $HENK = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $HENK = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Barray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Barray[$Numb2]}
sleep 1
done
ee2285f948eab5e15105a7da564053a4246ce4ee
3279
3278
2015-10-14T08:39:55Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason it is made, is because you don't want to use your raspberry pi only for just 1 thing.
You want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I than I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
if [ $HENK = "08" ]; then
Number=0
fi
if [ $HENK = "04" ]; then
Number=10
fi
if [ $HENK = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $HENK = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Barray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Barray[$Numb2]}
sleep 1
done
117a0e909c26013d0d4c9528298b209afccf784f
3280
3279
2015-10-14T08:51:05Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used previous scripts that I already made in previous blogs.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
if [ $HENK = "08" ]; then
Number=0
fi
if [ $HENK = "04" ]; then
Number=10
fi
if [ $HENK = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $HENK = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Barray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Barray[$Numb2]}
sleep 1
done
d85e1a8991dd5e7a50ed9d03b72133f1cb89a4d9
3281
3280
2015-10-14T13:08:39Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog x]] and [[blog y]].
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Barray. ( You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
if [ $HENK = "08" ]; then
Number=0
fi
if [ $HENK = "04" ]; then
Number=10
fi
if [ $HENK = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $HENK = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Barray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Barray[$Numb2]}
sleep 1
done
6b740126d67a6a78d3e17a16f6c5a107a9e75f56
3282
3281
2015-10-14T13:12:11Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog x]] and [[blog y]].
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Barray. ( You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
if [ $HENK = "08" ]; then
Number=0
fi
if [ $HENK = "04" ]; then
Number=10
fi
if [ $HENK = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $HENK = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Barray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Barray[$Numb2]}
sleep 1
done
d873abac55eadf6c9a04bb6491aaddb95afa7492
3284
3282
2015-10-21T07:26:38Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu and [[blog 12]](AlarmMenu.
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Barray. ( You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
if [ $HENK = "08" ]; then
Number=0
fi
if [ $HENK = "04" ]; then
Number=10
fi
if [ $HENK = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $HENK = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Barray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Barray[$Numb2]}
sleep 1
done
1258fe4ee04188c9434a9c12f3ae708539e8834c
3285
3284
2015-10-21T07:27:45Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Barray. ( You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
HENK=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Barray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $HENK != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $HENK = "20" ]; then
./${array[$Number]}
fi
if [ $HENK = "10" ]; then
./${array[$Numb2]}
fi
if [ $HENK = "08" ]; then
Number=0
fi
if [ $HENK = "04" ]; then
Number=10
fi
if [ $HENK = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $HENK = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Barray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Barray[$Numb2]}
sleep 1
done
1f85e6eab22eaeee5cca591e08652f69e820d736
3286
3285
2015-10-21T07:41:53Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
e550ab00524c44a1a048e2fbd1f0e6b1b013b7d2
3287
3286
2015-10-21T08:17:13Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menu's, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
fc067cb0f16c8b9891f2b4a6d6047d4f042dbcf3
3288
3287
2015-10-21T08:18:53Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menu's, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
03e9efc4430b2a0d8bc3eabe2d9890bad2c73bad
3289
3288
2015-10-21T08:25:01Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menu's, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
1d25725583f43bddce38173fa5a2da07bbe1d549
3290
3289
2015-10-21T08:32:45Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menu's, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
fe1714f2a2b18ec737c1b6614e30b5462024d65a
3291
3290
2015-10-21T08:34:04Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the other script to work.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menu's, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
77e4c98dd2090e942dbfbbb24db2b55de7b2b715
3292
3291
2015-10-21T08:42:49Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the an other script.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menu's, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
98e9141882449c45466def4a09467fc1fdcc55db
3293
3292
2015-10-21T08:43:43Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the an other script.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menus, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
1e724a2eece8d4fd66d67f3e2498985b752233c4
3294
3293
2015-10-21T08:47:27Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
Scroll Menu with multiple functions, where with every functions you can set up certain things.
Example:
Changing Alarm Time
Changing volume
The reason I made this, is because I don't want to use the raspberry pi only for just 1 thing.
I want to use it for multiple script and don't want to use a command section to get the an other script.
Here I can also put all my future projects in.
First mission is to make it possible that it goes up and down in the menu and than choose a certain function.
*1. Select option 1
*2. Select option 2
*3. go to the begin of the menu
*4. Go to the End of the menu
*5. Going down in the menu
*6. Going up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menus, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
4b56a96546b2d938fcac2379f68198a9f98f9756
3295
3294
2015-10-21T09:19:17Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from previous scripts. That you can see in [[blog 10]](PushMenu) and [[blog 12]](AlarmMenu).
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names.
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menus, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
05d45e5d2c4bf5eb8cf1220d2b745ee26058b140
3296
3295
2015-10-21T09:26:49Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1[[blog 10]] and 2[[blog 12]] in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show how it looks like )
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menus, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
91a047bbb3fb66f8e278cf043111dbd892d18937
3297
3296
2015-10-21T09:27:47Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with typing it's number.
The number counting begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show how it looks like )
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out. As you can see some of them don't use quotation marks.
I only did that to say that you only really need to put them if you want to print a text with a space in it.
And also here I gave the other 10 random names.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menus, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
4b12839a4d1a1780ef25826c2b6b22153cac9d81
3298
3297
2015-10-21T09:36:20Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show that it works )
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of them don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 number letters etc. in every row.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This parts check if the button is pressed. If the button is pressed it will
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 2 is counts down an with button 1 it counts up.
It counts down and up with 2. So that every time 2 new options gets showed on the display. Because in the array there are 12 menus, I used %12 that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back for option 1-2 when you are at option 11-12. )
I also explained this in [[blog 12]]:
With % it shares the number before it with the number after it and will give as result the number that couldn't get shared trough it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will than be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Will read the numbers that should later be displayed on the display. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning with "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array. ( Narray ) with after that the number and the second number ( Numb2 ) which says which names of the array should be displayed.
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The final script all together:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
348175c5f710674a439ac9703529147290b13ba0
3299
3298
2015-10-21T09:57:54Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show that it works )
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of them don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 number letters etc. in every row.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed look in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back to option 1-2 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
d8ac5a52291b475b02643720d8ae76163468c8ec
3300
3299
2015-10-21T09:59:25Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show that it works )
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of them don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 characters in every row.
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed look in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back to option 1-2 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
9f3328898f949714466de579738d8f4ec96114e1
3304
3300
2015-10-21T11:45:13Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show that it works )
[[File:ScrollMenuStart.jpg|300px|thumb|none|]]
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of them don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 characters in every row.
[[File:ScrollMenuEnd.jpg|300px|thumb|none|]]
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed look in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back to option 1-2 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
20c0cc13e1c2250381df8d26fdb236116582abd4
3305
3304
2015-10-21T11:57:34Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show that it works )
[[File:ScrollMenuStart.jpg|300px|thumb|none|]]
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of them don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 characters in every row.
[[File:ScrollMenuEnd.jpg|300px|thumb|none|]]
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed look in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back to option 1-2 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
26b1120ca0e9735be5f40baac88590225b8df604
3306
3305
2015-10-21T12:06:34Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board.
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show that it works )
[[File:ScrollMenuStart.jpg|300px|thumb|none|]]
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of them don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 characters in every row.
[[File:ScrollMenuEnd.jpg|300px|thumb|none|]]
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed look in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back to option 1-2 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:AlarmMenuStart.jpg|300px|thumb|none|This is the Alarm Menu that you can see if you activate it with button 2]]
6ba44d83dadc7ca4fa43bce11c77a286e0ce9a8c
File:ScrollMenuStart.jpg
6
1811
3301
2015-10-21T11:16:14Z
Cartridge1987
2553
The image shows what gets displayed when you start the scroll menu script.
wikitext
text/x-wiki
The image shows what gets displayed when you start the scroll menu script.
42c10c72935d62dcd00c5098778d024496c327b3
File:ScrollMenuEnd.jpg
6
1812
3302
2015-10-21T11:17:49Z
Cartridge1987
2553
This image shows what gets displayed when you go to the end of the Scroll menu.
wikitext
text/x-wiki
This image shows what gets displayed when you go to the end of the Scroll menu.
f83ff595094e58375e6cc9dbecde9072ff12de46
File:AlarmMenuStart.jpg
6
1813
3303
2015-10-21T11:22:46Z
Cartridge1987
2553
This image shows the Alarm given and the time on the Alarm Menu.
wikitext
text/x-wiki
This image shows the Alarm given and the time on the Alarm Menu.
e02f43c74ae059ece2e05c98c6d591d620220a71
Bw tool
0
1635
3307
3123
2015-10-21T12:12:33Z
Rew
3
/* Options Specifying the Device */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
For example, if you have an I2C module, add:
-I -D /dev/i2c-1
to switch to i2c-mode and specify the correct device.
If you have a rpi_ui plugged onto your raspberry pi, add:
-a 94
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched, so you need -D /dev/i2c-1, while on the first raspberry pi's -D /dev/i2c-0 is redundant as that is the default.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
The option
-S
will scan the bus for bitwizard protocol devices. This only works for SPI devices.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
c6f81b1048ab7f47e7ca6ae30b5cf48b2dcaf607
3308
3307
2015-10-21T12:14:34Z
Rew
3
/* Options Specifying the Device */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
For example, if you have an I2C module, add:
-I -D /dev/i2c-1
to switch to i2c-mode and specify the correct device.
If you have a rpi_ui plugged onto your raspberry pi, add:
-a 94
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched, so you need -D /dev/i2c-1, while on the first raspberry pi's -D /dev/i2c-0 is redundant as that is the default.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
The option
-S
will scan the bus for bitwizard protocol devices. This only works for SPI devices. Use the i2cdetect command (in the package i2ctools) to scan the I2C bus if you have i2c devices.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<short>
will write the 16-bit short to the port at addr. For example -W 81:1000 will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
c6aac47fd7531e6012bfeb59ba631157f13418ff
3309
3308
2015-10-21T12:25:10Z
Rew
3
/* Sending Data */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
For example, if you have an I2C module, add:
-I -D /dev/i2c-1
to switch to i2c-mode and specify the correct device.
If you have a rpi_ui plugged onto your raspberry pi, add:
-a 94
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched, so you need -D /dev/i2c-1, while on the first raspberry pi's -D /dev/i2c-0 is redundant as that is the default.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
The option
-S
will scan the bus for bitwizard protocol devices. This only works for SPI devices. Use the i2cdetect command (in the package i2ctools) to scan the I2C bus if you have i2c devices.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<data>:<type>
will write the data to the port at addr, using the datasize specified in "type": b for byte, s for short (16 bits), i for integer (32 bits) and l for long (64 bits) . For example -W 81:1000:s will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
b072ba4cf3f26299a55bedff0d4d8155d371357d
Relay
0
53
3310
2990
2015-10-21T15:03:09Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Turning On or off the BigRelay ==
With the 10 register you can turn a single relay on or everything off. ( It counts in hexadecimals )
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
40001b04057273aa9980a71778e9295d6b60de63
3311
3310
2015-10-21T15:09:49Z
Rew
3
/* Turning On or off the BigRelay */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Controlling the relays of Relay or BigRelay ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8, 10, 20 for relays 1-6.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
Which method you use is up to you. If your program "knows" the state of all the relays, using register 0x10 may be easier. But if say you have one program controlling one relay and another program controlling another, using the 20-25 registers is probably easier.
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-14]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
ee6d6cbcac10a401d62ffc2b69ed032cc020dae1
3312
3311
2015-10-21T15:10:35Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Controlling the relays of Relay or BigRelay ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8, 10, 20 for relays 1-6.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
Which method you use is up to you. If your program "knows" the state of all the relays, using register 0x10 may be easier. But if say you have one program controlling one relay and another program controlling another, using the 20-25 registers is probably easier.
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-1]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
e02da22ab1558391e58ca1ca88b5dc757ed4dd33
Blog 12
0
1808
3313
3276
2015-10-22T07:44:57Z
Cartridge1987
2553
/* Scripts AlarmMenu */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
[[File:AlarmMenuStart.jpg|300px|thumb|none]]
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
a950962a780071ea3b3115768483f23d0ffeb14a
3315
3313
2015-10-22T07:54:09Z
Cartridge1987
2553
/* CrontimeMM */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
[[File:AlarmMenuStart.jpg|300px|thumb|none]]
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Minutes
[[File:AlarmMinSettings.jpg|300px|thumb|none|]]
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
1082dc0765eef00a41f5a6281e7fd48674333cd1
3316
3315
2015-10-22T07:54:31Z
Cartridge1987
2553
/* CrontimeMM */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
[[File:AlarmMenuStart.jpg|300px|thumb|none]]
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as Crontime3, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Min
[[File:AlarmMinSettings.jpg|300px|thumb|none|]]
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
1ab9cf3b777a5c0871a42aa5c3e6574bc9c0e6b4
3317
3316
2015-10-22T07:54:54Z
Cartridge1987
2553
/* CrontimeMM */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTime3(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeTSE(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
[[File:AlarmMenuStart.jpg|300px|thumb|none]]
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as CrontimeHH, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Min
[[File:AlarmMinSettings.jpg|300px|thumb|none|]]
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
350bc539965557fd59663b8b8377dab2dad5085e
3318
3317
2015-10-22T07:58:40Z
Cartridge1987
2553
/* BETA! */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTimeHH(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeMM(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
[[File:AlarmMenuStart.jpg|300px|thumb|none]]
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as CrontimeHH, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Min
[[File:AlarmMinSettings.jpg|300px|thumb|none|]]
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
eb03e52d09239bf4262817e029f3b999a2f9afe7
File:AlarmMinSettings.jpg
6
1814
3314
2015-10-22T07:50:37Z
Cartridge1987
2553
In this image it shows what should display if you are setting up the minutes of the alarm.
wikitext
text/x-wiki
In this image it shows what should display if you are setting up the minutes of the alarm.
49e6a74ac4059a711bc883486b0bbe50768c0e2c
7FETs
0
49
3319
1193
2015-10-22T09:10:15Z
Cartridge1987
2553
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. Contact us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
4ba4e9dd8dce2d0c8a7b860ad7bfb115541badd2
3323
3319
2015-10-22T15:48:48Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. Contact us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, contact us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
93231016506711c1e4617842f3b86255f1900ea2
3325
3323
2015-10-22T15:49:59Z
Rew
3
/* powering 7fets */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. Contact us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, contact us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
dd7122aade57fcaf50af679a30953ce0593bfa60
Raspberry Relay
0
1708
3320
3133
2015-10-22T09:32:12Z
Rew
3
/* SPI version */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php contact] us: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
The SPI version has a jumper block. The pins 1,2 are marked, 3-4 are not. 1 is topright, 2 is top-left if you have the silkscreen on the board right-side-up. 1(top right) is SPI_CS0, the opposite corner (4, bottom left) is SPI_CS1. These signals can be connected to the other two with a jumper. 3, bottom-right is "board SPI CS". 2 top-left is the embedded processor's reset line. Putting a jumper 1-3 along the right of the jumper block will allow you to access the board using rapsberry pi SPI0 bus. Putting the jumper 1-2 along the top of the jumper block will aloow you to flash the onboard processor, should that be needed.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
111533d3e954f997fbe5c9e92c8635d176eff153
3321
3320
2015-10-22T09:42:56Z
Rew
3
/* SPI version */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php contact] us: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
The SPI version has a jumper block. The pins 1,2 are marked, 3-4 are not. 1 is topright, 2 is top-left if you have the silkscreen on the board right-side-up. 1(top right) is SPI_CS0, the opposite corner (4, bottom left) is SPI_CS1. These signals can be connected to the other two with a jumper. 3, bottom-right is "board SPI CS". 2 top-left is the embedded processor's reset line. Putting a jumper 1-3 along the right of the jumper block will allow you to access the board using rapsberry pi SPI0 bus. Putting the jumper 1-2 along the top of the jumper block will allow you to flash the onboard processor, should that be needed.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
6f268782d36cdef229e3e4d649dcc9dc31df0fc5
Default addresses
0
484
3322
3015
2015-10-22T11:13:48Z
Cartridge1987
2553
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| [[LCD]] || 0x82
|-
| [[DIO]] || 0x84
|-
| [[Servo]] || 0x86
|-
| [[7FETs]] || 0x88
|-
| [[3FETs]] || 0x8A
|-
| [[temp|Temp]] (sometimes called SPI_LM35) || 0x8C
|-
| [[relay|Relay]] || 0x8E
|-
| [[motor]] || 0x90
|-
| [[User Interface]] || 0x94
|-
| [[7_Segment]]|| 0x96
|-
<!--
| [[SPI_SPI]] || 0x98
|-
-->
| [[pushbutton]] || 0x9A
|-
| [http://www.bitwizard.nl/wiki/index.php/Relay bigrelay] || 0x9C
|-
| [[Dimmer]] || 0x9E
<!--
| thermo || 0xa0
|-
| ... || 0xA2
|-
-->
|-
| [[Raspberry Juice]] || 0xA4
|-
| [http://www.bitwizard.nl/wiki/index.php/Relay rpi spi relay] || 0xA6
|}
1d8441d598d531105ce15eb6e08ed77a4520dcca
3FETs
0
483
3324
3039
2015-10-22T15:49:41Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 3fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
4ab8092f3b6317aab40fe9bf0917fe52d63ad625
3326
3324
2015-10-22T15:50:36Z
Rew
3
/* powering 3fets */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards.
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering the 3FETs board ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
833562e90fb7fd25d543e1f8a988e3882dec52f5
Blog 14
0
1815
3327
2015-10-23T12:46:10Z
Cartridge1987
2553
Created page with " == The BigRelay board == In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off. This c..."
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[17];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on )
26794c5d4ba65bd254487154f744c680aa738927
3328
3327
2015-10-23T12:47:49Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[17];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %02d is for showing the numbers in decimals and %02x is for showing in hexadecimals. ( without 0x before it )
07f3b59fdd680e4ce2efdb4e77a04fcdc905bfce
Blog 14
0
1815
3329
3328
2015-10-23T13:08:39Z
Cartridge1987
2553
/* Raspberry Pi version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[17];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %02d is for showing the numbers in decimals and %02x is for showing in hexadecimals. ( without 0x before it )
c0ca87c2b4cbca83e962b99197702a8d5bafd8cc
3330
3329
2015-10-23T13:09:01Z
Cartridge1987
2553
/* Raspberry Pi version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[17];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %02d Relay: %02x", s, num);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %02d is for showing the numbers in decimals and %02x is for showing in hexadecimals. ( without 0x before it )
2eee657cccbcab023fff868427c057a04e94ecea
3331
3330
2015-10-23T14:53:54Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[17];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %02d is for showing the numbers in decimals and %d is for showing in decimals.
9377e1491bc72056e4f7853cac73b1ce2e05e017
3332
3331
2015-10-23T15:04:12Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[17];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals down and after that counts 1 up. So, 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
9170dd008c1cc51716d2c0d97f2889811c800190
3333
3332
2015-10-23T15:06:53Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[17];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
3c45ffd6796a63b4048571076e2b94e7f77e6b19
3334
3333
2015-10-23T15:12:32Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
9299dadb42b028bd8a8abc0e620a861f110cb0f1
3336
3334
2015-10-23T15:35:13Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
4ac7e11f6c062bdd3be3a28f1c8820fa442ecd3e
3337
3336
2015-10-23T15:53:52Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
da3741f86578ab3f200399dcfcd5a618d95bad55
3340
3337
2015-10-26T08:55:56Z
Cartridge1987
2553
/* The BigRelay board */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let one after another Relay turn on and the previous turn off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
6861915359d744b9da459c530ce446620b04dfe3
3350
3340
2015-10-26T11:24:13Z
Cartridge1987
2553
/* The BigRelay board */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
void loop (void)
{
static int num = 0x20;
static unsigned char s;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You coud also change the numbers in delay, but this makes it easier to find.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
c790e795b5a9e76d5f8f158d7e2e522b7d916806
3351
3350
2015-10-26T12:33:49Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int, that makes it possible to
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
5843afb0c4844472ff8a1620dbd6939988e744b0
3352
3351
2015-10-26T12:34:02Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( that is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int, that makes it possible to
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing in it decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
9fc3f024d459d0bba4b062b3279eee18418dc8f2
3353
3352
2015-10-26T12:51:46Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int, that makes it possible to count further than thousand.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if ( num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %d", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
07fd214df38fe3d6d798ef6a9b1d87117d3c38ac
3354
3353
2015-10-26T12:54:47Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int, that makes it possible to count further than thousand.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
7324c061b69b8787370714bbef3f4c3f4efe0e08
3355
3354
2015-10-26T13:09:21Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can count further than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
0a9a12fe378996785b13b2b736ac123b640dd8a6
3356
3355
2015-10-26T13:10:29Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can get a larger value than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and not showing any other number. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
5ae51b372fcdabf38946b403cc7c41ffc6b85193
3357
3356
2015-10-26T13:16:04Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-statement.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the last given relay number and will perform them.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
Here it will give to the variable i +1 up and will run activate the doreplay function.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can get a larger value than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and %u for showing in unsigned decimals. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
e46f90d4514bc1a11417885885f1f7e3ffd3c45a
3358
3357
2015-10-26T14:34:08Z
Rew
3
/* Raspberry Pi version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-state.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the given relay number and will perform the on/off cycle on that relay.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
Here it will iterate the variable i from 20 to 25 and will run activate the doreplay function on each iteration.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can get a larger value than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be out (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and %u for showing in unsigned decimals. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
c33b0998e0d0d8c55e239c84852732fd51577b4c
3359
3358
2015-10-26T14:39:06Z
Rew
3
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*RPi_UI board ([[User Interface]])
*BigRelay board ([[Relay]])
Hardware I used for the Arduino:
*SPI_LCD board([[LCD]])
*BigRelay board ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-state.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the given relay number and will perform the on/off cycle on that relay.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
Here it will iterate the variable i from 20 to 25 and will run activate the doreplay function on each iteration.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can get a larger value than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be zero (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u ", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and %u for showing in unsigned decimals. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
a8ea5c872f1097ffcfd33a225e421c5a399055d1
3374
3359
2015-10-29T14:52:18Z
Cartridge1987
2553
/* The BigRelay board */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/bigrelay BigRelay board] | ([[Relay]])
Hardware I used for the Arduino:
*[http://www.bitwizard.nl/shop/lcd-interface SPI_LCD board] | ([[LCD]])
*[http://www.bitwizard.nl/shop/bigrelay BigRelay board] | ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-state.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the given relay number and will perform the on/off cycle on that relay.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
Here it will iterate the variable i from 20 to 25 and will run activate the doreplay function on each iteration.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can get a larger value than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be zero (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u ", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and %u for showing in unsigned decimals. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
d5cc9fd68741a42c0393fa7b029f9bbc7baf8feb
File:ArduinoBigRelay.jpg
6
1816
3335
2015-10-23T15:30:55Z
Cartridge1987
2553
Connection from the arduino, the lcd and the bigrelay.
wikitext
text/x-wiki
Connection from the arduino, the lcd and the bigrelay.
c096bab6ad709ff73eb0bf63b0bf0131a28dd532
Blog 13
0
1809
3338
3306
2015-10-26T08:34:17Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this blogpost I am making a Scroll Menu, what is a menu where I make a choose from a list of my previous and future menus.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board.
The mission is to make it possible that the menu goes up and down and that I than get select between the 2 options displayed on the first and second line of the Rp_ui_board([[User Interface]]).
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
The 2 scripts I previous made are also included as option 1([[blog 10]]) and 2([[blog 12]]) in the Script Menu.
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 names of previous scripts and 10 other random names. ( I don't have 10 other menu scripts, so I only made it to show that it works )
[[File:ScrollMenuStart.jpg|300px|thumb|none|]]
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of them don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 characters in every row.
[[File:ScrollMenuEnd.jpg|300px|thumb|none|]]
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed look in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( so that you not have to go all back to option 1-2 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:AlarmMenuStart.jpg|300px|thumb|none|This is the Alarm Menu that you can see if you activate it with button 2]]
2559ef0c5b70d7f7f493fcb5d02355f36a454469
3349
3338
2015-10-26T11:05:08Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this post I am making a Scroll Menu, what is a menu where I can choose from a list of my previous and future menus to use.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board([[User Interface]]).
The mission is to make it possible that the menu goes up and down and that I then can select between the 2 options displayed on the first and second line of the Rp_ui_board([[User Interface]]).
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 previous scripts(option 1([[blog 10]]) and 2([[blog 12]])) and give the other 10 random names. ( I only did that to show the scrolling works. )
[[File:ScrollMenuStart.jpg|300px|thumb|none|]]
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of these names don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 characters in every row.
[[File:ScrollMenuEnd.jpg|300px|thumb|none|]]
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed it looks in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( So that you don't have to go all back to option 2-4 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:AlarmMenuStart.jpg|300px|thumb|none|This is the Alarm Menu that you can see if you activate it with button 2]]
ae4d416df639094e18988e66158f24cc9cdb58e5
Blog 12
0
1808
3339
3318
2015-10-26T08:35:37Z
Cartridge1987
2553
/* BETA! */
wikitext
text/x-wiki
== BETA! ==
Alarm
This time I am going to make an Alarm.
For this I will use:
*Rp_ui_board([[User Interface]])
*3pin earplugs ( I didn't have a speaker )
I want to make it possible that you can change the alarm time through the pushbuttons.
The options you should get is:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTimeHH(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeMM(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can press use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
[[File:AlarmMenuStart.jpg|300px|thumb|none]]
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as CrontimeHH, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Min
[[File:AlarmMinSettings.jpg|300px|thumb|none|]]
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
6fecafd258355ac2ace946d2e0af2c3a0c633022
3348
3339
2015-10-26T10:47:18Z
Cartridge1987
2553
/* BETA! */
wikitext
text/x-wiki
== Alarm Menu ==
This time I made an alarm that you can control through to the push buttons.
For this I will use:
*Rp_ui_board([[User Interface]])
*3pin earplugs ( I didn't have a speaker )
The options in the alarm menu:
Change alarm minutes
Change alarm hours
stop alarm music playing
Reset alarm time
Activating the alarm time given
show on display current time + time of the alarm.
*AlarmMenu
Main menu where you can select the scripts
*TimeAndAlarm(Button 3)
This will show at start up the time given as alarm and the current time.
*CronTimeHH(Button 1)
Here you can set the hour you want the alarm to turn on.
*CrontimeMM(Button 2)
Here you can set the minute you want the alarm to turn on.
*AcTime(Button 6)
This will put the given hour and or minute in the crontab.
*StopSong(Button 4)
To stop the alarm song/sound that is now playing.( killall omxplayer.bin )
*ResetAlarm(Button 5)
This will reset the hour and minutes to 99 so that they won't be usable. ( because minutes goes from 0-59 and hours from 0-23)
How do you use my alarm?
When you start the script, you can use all the 6 buttons.
When started up it will start at button 3. which is the button that shows the current time and time of when the alarm song plays. With button 1 you change the specific hour of when the song has to be played from the alarm. After button 1 pressed you change the hour with button 1 till 4.
1 = +1
2 = -1
3 = +5
4 = -5
If you then want to confirm you want to have the specific hour you selected you have to press 5. With button 6 pressed you leave the script. ( If you didn't press 5 before 6 the given time will not be remembered )
Button 2 is in the same way designed as button 1 outside of it instead changing hours it changes minutes.
Button 4 is just 1 button press to stop the song that is currently playing. When you get out of this menu it should be possible that it can play an alarm song again the next day.
Button 5 will reset the alarm time to 99, so that it will never play an alarm.
Button 6 Is to activate the alarm.
==Scripts AlarmMenu==
#!/bin/bash
#BUTTON=CrontimeMM
#BUTTON=CrontimeHH
#BUTTON=AcTime
#BUTTON=StopSong
BUTTON=TimeAndAlarm
#BUTTON=ResetAlarm
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
DETECT=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $DETECT != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $DETECT = "20" ]; then
BUTTON=CrontimeHH
fi
if [ $DETECT = "10" ]; then
BUTTON=CrontimeMM
fi
if [ $DETECT = "08" ]; then
BUTTON=TimeAndAlarm
fi
if [ $DETECT = "04" ]; then
BUTTON=StopSong
bw_tool -I -D /dev/i2c-1 -a 94 -t "Audio mute"
fi
if [ $DETECT = "02" ]; then
BUTTON=ResetAlarm
fi
if [ $DETECT = "01" ]; then
BUTTON=AcTime
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$BUTTON
sleep 1
done
For this I used the same script I explained in [[Blog 10]]. Only difference is that he opens other scripts.
[[File:AlarmMenuStart.jpg|300px|thumb|none]]
==Script TimeAndAlarm==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
The script will read the given minutes and hours:
Min=$(cat Minutes)
Hr=$(cat Hours)
The read minutes and hours will then be printed on the display.
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " $(printf %02d $Hr)":"$(printf %02d $Min)
==Script CrontimeHH==
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Scan=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Scan != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Scan = "20" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 01) % 24 ))
fi
if [ $Scan = "10" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 23) % 24 ))
fi
if [ $Scan = "08" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 05) % 24 ))
fi
if [ $Scan = "04" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
TimeOnhh=$(( (TimeOnhh + 19) % 24 ))
fi
if [ $Scan = "02" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
echo $TimeOnhh > Hours
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Set!"
sleep 1
fi
if [ $Scan = "01" ]; then
exit
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Hours "$(printf %02d $TimeOnhh)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
sleep 1
done
Like the AlarmMenu it uses the same script as from [[Blog 10]].
Only what is special is:
echo $TimeOnhh > Hours
Which sends the given hour number to a folder named Hours.
== CrontimeMM ==
This works the same as CrontimeHH, only
*TimeOnhh is changed to TimeOnmm
*Hours is changed to Min
[[File:AlarmMinSettings.jpg|300px|thumb|none|]]
==Script AcTime==
#!/bin/bash
Min=$(cat Minutes)
Hr=$(cat Hours)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Activated "
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "If times set"
The script read the minutes and hours given.
Min=$(cat Minutes)
Hr=$(cat Hours)
After that it puts the times in the crontab.
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
==Script StopSong==
#!/bin/bash
killall mplayer
This will end all the mplayer files that are running.
==Script ResetAlarm==
#!/bin/bash
Min="99"
Hr="99"
echo $Min > Hours
echo $Hr > Minutes
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "Alarm " "$Hr":"$Min" "Res"
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "Time "`date +%T`
Min="99"
Hr="99"
Will change the time, when the alarm goes to 99. ( A time that of course never get reached )
echo $Min > Hours
echo $Hr > Minutes
This is to save the times in the Hours and Minutes folder. So that if the time normally get showed everybody will see 99:99 as time. ( And not 00:00! I don't want to confuse people)
(echo "# mm hh dom mon dow command"; echo ""$Min" "$Hr" * * * mplayer /home/pi/ru.mp3") | crontab
Then it will put the times in the crontab and prints them out on the display.
b6ca883c001089c95e61f2335a2eaa66a602a5dd
Blog 10
0
1806
3341
3250
2015-10-26T08:58:16Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, this time I am finally going to put together what I wanted.
I am going to use previous scripts:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( not visible on display! ) (From [[blog 05]])
And put them all together in a push button menu.
So that I can show the information from one of the six scripts on the display and use the pushbuttons to choose which one I want to see.
I still had to modify the scripts. But I didn't want to change them so I made a copy from some:
Example:
cp timer time_load
I made the scripts more basics, so that they only print the information on screen. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to also remove the second line. It only cleans first row with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it makes Print Showtemp2.
( to detect which button gives which number. You have to copy paste this line and press the button you want to know:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from showtemp2. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
72c1295767d472ab421fcb74c1e646b383712581
3342
3341
2015-10-26T09:22:13Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, In this post I am going to show the push menu I made. In the push menu I have the 6 previous scripts I previous made and putted them together.
With every button on the push button one of the scripts can run.
The list of buttons with which script they run:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( Not visible on the display! ) (From [[blog 05]])
I still had to modify most of the scripts. I didn't want to change them so I made a copy that I could edit.
Example:
cp timer time_load
With modifying the scripts I made them more basic, so that they only print their information on the display. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from pushmenu isn't made to also remove the second line. It only cleans first row with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
Now the script itself:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it makes Print Showtemp2.
( to detect which button gives which number. You have to copy paste this line and press the button you want to know:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from showtemp2. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
052f67b3c1339d30f22c8286cdd1b91e0eeb56e4
3343
3342
2015-10-26T09:34:11Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, In this post I am going to show the push menu I made. In the push menu I have the 6 previous scripts I previous made and putted them together.
With every button on the push button one of the scripts can run.
The list of buttons with which script they run:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( Not visible on the display! ) (From [[blog 05]])
I still had to modify most of the scripts. I didn't want to change them so I made a copy that I could edit.
Example:
cp timer time_load
With modifying the scripts I made them more basic, so that they only print their information on the display. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from the push menu isn't made to also remove the second line. It only cleans first line with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
This is than the script of the push menu:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
All the 6 buttons reference to the 6 scripts:
*1. Temperature
*2. Time
*3. CPU + GPU
*4. Temperature at weather station
*5. Wind at weather station
*6. ui
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first list with #'s can be deleted, but I made it so that I can change it to my preferences.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the last one.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it makes Print Showtemp2.
( to detect which button gives which number. You have to copy paste this line and press the button you want to know:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from showtemp2. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
b899fd6842d01e9554f8e006b6934dc6962421fd
3344
3343
2015-10-26T09:44:42Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, In this post I am going to show the push menu I made. In the push menu I have the 6 previous scripts I previous made and putted them together.
With every button on the push button one of the scripts can run.
The list of buttons with which script they run:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( Not visible on the display! ) (From [[blog 05]])
I still had to modify most of the scripts. I didn't want to change them so I made a copy that I could edit.
Example:
cp timer time_load
With modifying the scripts I made them more basic, so that they only print their information on the display. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from the push menu isn't made to also remove the second line. It only cleans first line with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
This is than the script of the push menu:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first row with #'s for them can be deleted. I made it so that I can choose which script the push menu has to start with.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the previous chosen script.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "20" ]; then
Print=showtemp2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 20.
Then it is going to run the script: Showtemp2.
( To detect which button gives which number. You have to copy paste this line and press the button you want to know:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from showtemp2 in our example. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
8fe92e303139783358101e0d80b07d82bc075187
3345
3344
2015-10-26T09:47:30Z
Cartridge1987
2553
/* Push menu */
wikitext
text/x-wiki
== Push menu ==
Hello, In this post I am going to show the push menu I made. In the push menu I have the 6 previous scripts I previous made and putted them together.
With every button on the push button one of the scripts can run.
The list of buttons with which script they run:
*1. Temperature (From [[blog 05]])
*2. Time with load averages (From [[blog 04]])
*3. CPU + GPU (From [[blog 08]])
*4. Temperature at weather station (From [[blog 09]])
*5. Wind a weather station (From [[blog 09]])
*6. Defining Temperature ( Not visible on the display! ) (From [[blog 05]])
I still had to modify most of the scripts. I didn't want to change them so I made a copy that I could edit.
Example:
cp timer time_load
With modifying the scripts I made them more basic, so that they only print their information on the display. ( If I wouldn't do this it will make the screen refresh too much or ignore me pushing the button )
So the things I had to remove from the scripts were:
*while true; do
*done
*echo
*10:00
*11:00
*sleep
Note!
You shouldn't delete 11:20, because the script from the push menu isn't made to also remove the second line. It only cleans first line with 11:00.
Example from how the 'Time with load averages'(./time_load) has to look like after removing everything that is not needed:
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
load=`cut -d' ' -f-3 /proc/loadavg`
$DISPL -t `date +%H:%M:%S`
$DISPL -W 11:20:b
$DISPL -t $load
This is than the script of the push menu:
#!/bin/bash
#Print=showtemp2
#Print=time_load
#Print=DIAMoscow2
#Print=cgpu2
#Print=DIAMWind
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
if [ $Button = "20" ]; then
Print=showtemp2
fi
if [ $Button = "10" ]; then
Print=time_load
fi
if [ $Button = "08" ]; then
Print=cgpu2
fi
if [ $Button = "04" ]; then
Print=DIAMoscow
fi
if [ $Button = "02" ]; then
Print=DIAMWind
fi
if [ $Button = "01" ]; then
Print=ui
fi
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
sleep 1
done
Print=ui
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
The first row with #'s for them can be deleted. I made it so that I can choose which script the push menu has to start with.
If you remove Print=ui, the display will start with an empty screen. (What isn't a problem, but you will get error messages on the terminal.)
The 10:00 will at the start-up it remove everything from display.
while true; do
Button=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $Button != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:00
fi
First it will look if there is a button pressed. If there is no button pressed it will be 00, and then it will be just refresh the previous chosen script.
When a button is pressed 10 will directly remove the previous text. Because at the beginning of the code it will check:
If 30:b doesn't check a number that isn't(with !=) 00 it will refresh the display.
So everything will be removed when the button is pressed.
if [ $Button = "08" ]; then
Print=cgpu2
fi
Then it checks with 6 times if there is a button pressed with the number given in the if statements.
When then for example someone presses button 1 -> 08.
Then it is going to run the script: cgpu2.
( To detect which button gives which number. You have to copy paste this line and press the button you want to know:
bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b
01
)
bw_tool -I -D /dev/i2c-1 -a 94 -w 11:00
./$Print
It says it has to place on the line 11:00. ( If you remove that part, it paste the text with the previous one, while refreshing.)
With ./$print he then prints the information from the button that was last pressed. (So it would then print out the information from cgpu2 in our example. )
sleep 1
Thanks to the sleep you now have to wait a second for the refresh of the screen but also for the code to scan which button has been pressed.
I hope this can also be useful for your own use!
[[File:CPU&GPU.jpg|400px|thumb|none|]]
d3639484e934be23b219c7a637591b686c4340d7
Blog 11
0
1807
3346
3255
2015-10-26T10:23:16Z
Cartridge1987
2553
/* Clock based On/off system */
wikitext
text/x-wiki
== CHARLEY BETA! ==
== Clock based On/off system ==
In this post I am going to work with crontab. What I am going to show is how you can make it possible to turn a light on or off on special times.
I made this as some anti-criminal technique. So, that when I am away the lights are still on at night or day in the house. With that the house doesn't look like a house that has nobody in it.
For this system I am of course going to try if it works with shorter times otherwise I have to wait 8 hours for a lamp to get on or off.
So when I start the code I plan it 1 minute in the future.
I already made a lamp go on and off in [[blog 02]]. So I am going to use that same way for turning on and off the lamp.
Working with crontab has to all be done manually:
crontab -e
has to be done to open crontab for editing
I then have to put this in to make it work to turn the light on at 13:19 and turn the light off at 13:20:
# mm hh dom mon dow command
19 13 * * * /usr/local/bin/gpio write 3 1
20 13 * * * /usr/local/bin/gpio write 3 0
To read a certain part:
crontab -l |grep bin/gpio
( With -v you can also let the other parts without bin/gpio appearing.
For the people who don't understand:
*1 (mm)Minute 0-59
*2 (hh)Hour 0-23 (0 = midnight)
*3 (dom)Day 1-31
*4 (mon)Month 1-12
*5 (dow)Weekday 0-6 (0 = Sunday)
So the text from my is now saying:
gpio write 3 1 at 13:19
gpio write 3 0 at 13:20
To manually change it in the command line:
( echo "# mm hh dom mon dow command" ; echo '19 13 * * * /usr/local/bin/gpio write 3 1' ; echo '20 13 * * * /usr/local/bin/gpio write 3 0' ) | crontab
( You can of course also use it as alarm clock, then you only have to change the command to the location of the audio file you want to play.)
== manual Display Alarm ==
d0cc55571df287464fb79f3b1c3ef16a72921dd7
3347
3346
2015-10-26T10:27:43Z
Cartridge1987
2553
/* Clock based On/off system */
wikitext
text/x-wiki
== CHARLEY BETA! ==
== Clock based On/off system ==
In this post I am going to work with crontab. What I am going to show is how you can make it possible to turn a light on or off on special times.
I made this as some anti-criminal technique. So, that when I am away the lights are still on at night or day in the house. With that the house doesn't look like a house that has nobody in it.
For this system I am of course going to try if it works with shorter times otherwise I have to wait 8 hours for a lamp to get on or off.
So when I start the code I plan it 1 minute in the future.
I already made a lamp go on and off in [[blog 02]]. So I am going to use that same way for turning on and off the lamp.
Working with crontab has to all be done manually:
crontab -e
has to be done to open crontab for editing
I then have to put this in to make it work to turn the light on at 13:19 and turn the light off at 13:20:
# mm hh dom mon dow command
19 13 * * * /usr/local/bin/gpio write 3 1
20 13 * * * /usr/local/bin/gpio write 3 0
To read a certain part:
crontab -l |grep bin/gpio
( With -v you can also let the other parts without bin/gpio appearing.
For the people who don't understand:
*1 (mm)Minute 0-59
*2 (hh)Hour 0-23 (0 = midnight)
*3 (dom)Day 1-31
*4 (mon)Month 1-12
*5 (dow)Weekday 0-6 (0 = Sunday)
So the text from my is now saying:
gpio write 3 1 at 13:19
gpio write 3 0 at 13:20
To manually change it in the command line:
( echo "# mm hh dom mon dow command" ; echo '19 13 * * * /usr/local/bin/gpio write 3 1' ; echo '20 13 * * * /usr/local/bin/gpio write 3 0' ) | crontab
( You can of course also use it as alarm clock, then you only have to change the command to the location of the audio file you want to play.)
[[File:DSC05964.JPG|300px|thumb|none|]]
== manual Display Alarm ==
5c985916f7f1dfa9a0562eb3edc3e4d5aecc4f87
7FETs
0
49
3360
3325
2015-10-26T15:38:47Z
Cartridge1987
2553
/* powering 7fets */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. Contact us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
23d01a62969dfcb5ae3a2320e5b39f983305f745
3361
3360
2015-10-27T08:22:48Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards.
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
e3d9968037a84d2cad51e79acf2bef0a1c1456a2
Blog 15
0
1817
3362
2015-10-29T09:13:23Z
Cartridge1987
2553
Created page with "== Working with stepper motor == In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper m..."
wikitext
text/x-wiki
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
30df348764ae3d39343c908a7e83427260f28f41
3363
3362
2015-10-29T09:13:39Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
40cf70b5444b7cc1f10741d1f469ff46cda87312
3365
3363
2015-10-29T09:53:53Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
f052448b57b95f8af781c867d0d7a4f488e61ac6
3366
3365
2015-10-29T10:28:11Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
d789f4cb7b887fd4514133834bc9ed8a6a9cb12e
3367
3366
2015-10-29T10:46:06Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
Now the programming part:
bedc833ff7c695e134d0e8edc501ee7196ec2747
3368
3367
2015-10-29T11:01:37Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
set_var(0x88, 0x30, 0xff);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
dcc75049f31cd4f77bc4026328abc3f80abce6eb
3369
3368
2015-10-29T11:07:17Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
set_var(0x88, 0x30, 0xff);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
b3e6c9e2fd8f285615150661d83f313e0c34d91b
3370
3369
2015-10-29T11:47:34Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
set_var(0x88, 0x30, 0xff);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
set_var(0x88, 0x30, 0xff);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
5a410a63673a3cd4001cfaba9e5c26dc66c2dcf0
3371
3370
2015-10-29T11:55:35Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
df5a3b1d7a42f7d4b1889bf7093475208946fea8
3372
3371
2015-10-29T12:34:18Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
af59ad9f41e8cebe2956c425ce8511a7286018ed
3373
3372
2015-10-29T14:17:21Z
Cartridge1987
2553
/* rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets]
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + void. ( The other parts you can just copy paste from previous page. I didn't want to make this page too long )
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
6a6f646c0e8ca7c0a5e28773936896727b84011b
3375
3373
2015-10-29T14:55:34Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + void. ( The other parts you can just copy paste from previous page. I didn't want to make this page too long )
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
81aae6b1751e53cbda270ba19bc3b2be5ab9a79f
3376
3375
2015-10-29T16:02:09Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
ba9744fe9401eac706a240388c100ba26b205c2a
3377
3376
2015-10-29T16:51:22Z
Cartridge1987
2553
/* BETA */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
c74fab35ba0a1ffd880c4d653698dba9ffa104a5
3378
3377
2015-10-30T13:36:11Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
$Address -W 42:-200:i
Target=`$Address -R 41:i`
Rot=-200
#Speed=200
#$Address -W 43:$Speed:b`
while true; do
Current=`$Address -R 40:i`
if [ "$Current" = "$Target" ]; then
sleep 10
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
fi
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
e1759c16bf0e756b804b6f066360f6fe11ecda44
File:7fetsStepper.jpg
6
1818
3364
2015-10-29T09:50:56Z
Cartridge1987
2553
A 28BYJ-48 Stepper Motor connected with a 7fets board.
wikitext
text/x-wiki
A 28BYJ-48 Stepper Motor connected with a 7fets board.
c15d2c1f8b7ff5928a50ae2f4eee05cae36a750b
Blog 15
0
1817
3379
3378
2015-10-30T14:05:36Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
8efe1c15f28f1f764ac998084fcd8299d784864a
3380
3379
2015-10-30T14:06:05Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
065078213f04eaab8ff142e96d40c204a51d12f2
3381
3380
2015-10-30T14:15:01Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
52a1b3dc97361f4466a04541eef35effd2f1204d
3382
3381
2015-10-30T14:27:20Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
ee83c3c72c39c2ec57aa00b9f3b2035fc511494c
3383
3382
2015-10-30T14:41:42Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. ( It can also put on pin 1 or all the other dev power pins ) You can see at the arduino set-up picture how I put them.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
59ed13e5022b18fbb07c031550cf98da37e32d33
3384
3383
2015-10-30T14:55:37Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm 6 Pin IDC cable ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. ( It can also put on pin 1 or all the other dev power pins ) You can see at the arduino set-up picture how I put them.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
cd0a4fef5839231d286735346b00503f1da4df9d
3385
3384
2015-10-30T14:56:37Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
(connected with the user interface through a spi cable)
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. ( It can also put on pin 1 or all the other dev power pins ) You can see at the arduino set-up picture how I put them.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
378b46a9089f0d8bfdc07a6697f4c62c3c57560e
3386
3385
2015-10-30T15:26:41Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
f5646318a7e4e5ec2e5c50891fa45c2b6740dc01
3387
3386
2015-10-30T16:08:30Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
6123a374ace7ffc685849ee7442f238abbc85a0c
3388
3387
2015-10-30T16:08:54Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
1df6c9dd6f10978a49592bd8cc11da51ffff3911
3389
3388
2015-10-30T16:23:48Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with this project was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
bcac7134dc35923061866140b709116e362152b4
3390
3389
2015-10-30T16:24:44Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
93bf57d284ae85e90ef43256fc4238befc47e54d
3391
3390
2015-11-02T08:26:00Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself)
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
7aeaab769eef50b1ba1e18227f3c92c8d94a12ee
3392
3391
2015-11-02T09:35:29Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
50265a368c3f7f6948e5ef422cf06b93481a3de9
RGB clock
0
25
3393
3042
2015-11-02T11:00:47Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the RGB clock kit.
You can [http://www.bitwizard.nl/shop/kits/rgb-clock here] buy the components of the clock to make one yourself.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
The laser cutter leaves a bit of brown residue near the laser-cut edges. You can sand this off with a fine sandpaper.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_back_complete_edit.jpg|none|thumb|300px|alt=The full clock with a few locations marked]]
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton of the multio, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
31cb055dda1e917e6e819d566a9d72f3df886b57
3394
3393
2015-11-02T11:02:43Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the [http://www.bitwizard.nl/shop/rgb-clock-full-kit RGB clock kit].
You can [http://www.bitwizard.nl/shop/kits/rgb-clock here] buy the components of the clock to make one yourself.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
The laser cutter leaves a bit of brown residue near the laser-cut edges. You can sand this off with a fine sandpaper.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_back_complete_edit.jpg|none|thumb|300px|alt=The full clock with a few locations marked]]
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton of the multio, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
16b0f979f9fb886e9f1c49b2106427a5a4d8d3c0
Raspberry Pi camera extension kit
0
1665
3395
3113
2015-11-02T11:07:32Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:Rpicamextstraight.jpg|thumb|300px|Camera extension kit with straight pins]]
[[File:Rpicamextangle.jpg|thumb|300px|Camera extension kit with angled pins]]
== Overview ==
This kit allows you to expand the length of the Raspberry Pi camera by converting the standard FFC cable to a generic 2.54mm pin set. You could use the attached connectors to create a ribbon cable, let us create the ribbon cable, or use your own cable. Please note that the ribbon cable has an angled connector. The kit can be found in the shop [http://www.bitwizard.nl/shop/kits/rpi-camera-extension here]
== Connecting ==
You can recognise this version by the way the connectors one the "camera board" converter are mounted on opposite sides of the PCB.<br>
<br>
This is very straightforward:<br>
- Turn off your Raspberry Pi<br>
- Connect the opposite-side FPC cable (supplied with the kit) to the CSI connector of your Raspberry Pi, and the adapter board labeled "Raspberry Pi". The silver connectors on the FPC cable should face the HDMI connector on the raspberry pi side. On our adapter board the silver connectors on the FPC face AWAY from the PCB. <br>
- Connect the opposite side FPC cable (supplied with the camera module) to the camera module, and the adapter board labeled "Camera board". Again on our adapter board the silver connectors on the FPC face AWAY from the PCB.<br>
- Connect the IDC cable to both adapter boards. Make sure pin 1 of the cable lines up with de pin 1 markings on both adapter boards (please note: On the board marked with "Camera board", the pin 1 marking may be obstructed by the right-angle connector. On both boards the BitWizard logo is on the pin16 side of the board)<br>
<br>
If you have trouble inserting the FPC into the connectors, please see: [[connecting FPCs]].
== Splitting cable ==
For more flexability, it is possible to split the cable into individual wires. Keep in mind that you have to keep the following wires fused together:<br>
Pin 2&3<br>
Pin 4&5<br>
Pin 7&8<br>
Pin 10&11<br>
Pin 14&15
2c895a46b69fae04b72223a0df0da1aee57411cb
Raspduino
0
1572
3396
2891
2015-11-02T11:11:05Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/shop/avr-boards/raspduino BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
=== Setup ===
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
=== Running the Project ===
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c written in Arduino Wiring can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/wiring-blink/src/main.c here]. An AVR native version is also [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c provided]. More can be found among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
17054e9378e548624267ecbfd9e6e8d7097ad379
FTDI ATmega
0
6
3397
2798
2015-11-02T11:12:19Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:ftdi_atmega_top.jpg|thumb|300px|alt=FTDI-atmega Development Board|FTDI-atmega Development Board]]
The FTDI-atmega Development board is a general purpose development board. The PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an ATmega168 chip.<br>
The FTDI-atmega development board comes completely assembled and ready to use. It can be ordered from the [http://www.bitwizard.nl/shop/avr-boards/avr-dev-board-70 Bitwizard Catalog].
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega168 datasheet]
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf FT232RL datasheet]
=== Related projects ===
* [[Temperature_control]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>GND</td><td>GND</td></tr>
<tr><td>PC3</td><td>PC2</td></tr>
<tr><td>PC1</td><td>PC0</td></tr>
<tr><td>PB5</td><td>PB4</td></tr>
<tr><td>PB3</td><td>PB2</td></tr>
<tr><td>PB1</td><td>PB0</td></tr>
<tr><td>PD7</td><td>PD6</td></tr>
<tr><td>PD5</td><td>PD4</td></tr>
<tr><td>PD3</td><td>PD2</td></tr>
<tr><td>VCC</td><td>VCC</td></tr>
</table>
=== LEDs ===
* led1 is connected to VCC (the top one, called led2 on V7.0)
* led2 is connected to CBUS0 (FT232RL) PC -> AVR activity
* led3 is connected to CBUS1 (FT232RL) AVR -> PC activity
* led4 is connected to PC4
* led5 is connected to PC5
=== Arduino Pinout ===
When using the Arduino IDE, the layout of the header is as follows:
<table border=1>
<tr><td>1</td><td>GND</td><td>GND</td></tr>
<tr><td></td><td>A3</td><td>A2</td></tr>
<tr><td></td><td>A1</td><td>A0</td></tr>
<tr><td></td><td>13</td><td>12</td></tr>
<tr><td></td><td>11</td><td>10</td></tr>
<tr><td></td><td>9</td><td>8</td></tr>
<tr><td></td><td>7</td><td>6</td></tr>
<tr><td></td><td>5</td><td>4</td></tr>
<tr><td></td><td>3</td><td>2</td></tr>
<tr><td></td><td>V+</td><td>V+</td><td>20</td></tr>
</table>
<ul>
<li>Unlike a regular arduino, there are 2 onboard LED's, connected to pin A4 and A5. You can use those LED's with digitalWrite(A4,HIGH) for led 4, or A5 for led 5. This means pin 13 is free for regular use.</li>
<li>Pin 0 and 1 are used for the COM interface just like a regular arduino.</li>
<li>Pin 3, 5, 6, 9, 10 and 11 support PWM (analogWrite), just like a regular arduino.</li>
</ul>
Note that the FTDI_ATmega runs at 20MHz, and the arduino runs at 16MHz. It should be possible to tell the arduino environment that your chip runs at 20MHz, as some people run their arduino at 20MHz.
See: [[Modifying the arduino IDE for 20MHz]] for more tricks needed to run the arduino environment at 20mHz.
== Jumper settings ==
SV1 (next to the AVR): ICSP-Enable.<br>
1-2: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
2-3: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
SV4 (next to the LEDs): Power supply selection.<br>
No jumper: 3V3 > 90mA, extra regulator needs to be mounted.<br>
1-2: Runs on 5V from USB<br>
2-3: Runs on 3V3 from the FTDI chips internal regulator. (officially only up to 8MHz!)<br>
SJ1 (between the FTDI and the place for the regulator).
When you bridge this, the board becomes more "arduino compatible". The AVR will reset when you connect to the serial port. On arduino this is used to get the AVR into the bootloader.
SJ2 (between the crystal and the AVR)
This allows the AVR to run off a clock generated from the FTDI. Not really useful if you already have the crystal installed. And the FTDI can't generate 20MHz.
== Use as a programmer ==
The ftdi_atmega can be used as a programmer for ICSP programming other Atmel processors.
You can program the avrusb500 firmware into the board. The board will then act as an STK500V2 programmer at 115200 baud. Download the sources and/or the hexfile here: http://www.bitwizard.nl/software/avrusb500/
The avrusb500 is open source written by tuxgraphics http://tuxgraphics.org/electronics/200510/article05101.shtml
== Programming ==
This section describes how you get your program into the processor.
=== Linux ===
You can program the processor using any ICSP programmer that you might have. In that case, the jumper SV1 should then be in the upper position (away from the ICSP connector).
Or you can program it with the ftdi bitbang programmer included on the board. In that case, the jumper SV1 does not play a role.
==== The Arduino way ====
Here is the documentation: http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
The ftdi-bitbang programmer-driver for avrdude is not included in the standard avrdude program. The reason is that the patch uses the ftdi library FTD2xx and not the open source libftdi.
In the avrdude bug tracking system another patch is doing the rounds, but that one is really slow because it doesn't exploit the ftdi's synchronous mode.
A precompiled avrdude version can be downloaded here: http://www.bitwizard.nl/avrdude.zip . The zipfile contains "quick and dirty" instructions to replace the avrdude binary in /usr/bin with a script so that when "arduino IDE" calls it, the program gets programmed into the board.
==== The "normal" way ====
As an example, we will use the "demo_lcd" program, which is available at [[http://www.bitwizard.nl/software the bitwizard software download directory]].
Download the .zip file, extract it, and cd to the demo_lcd directory. Now, type
make load
And you're done!
=== Windows ===
See the linux section above.
== Writing programs ==
The chip is an ATmega168. http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf
== Future hardware enhancements ==
* Provide a 3- or 4-pin header with the i2c pins (to communicate with wiimote and other peripherals). The leds need to be disabled for this to work. :-(
== Future software enhancements ==
* Add a reset button
== Changelog ==
=== 7.1 ===
* Added decoupling capacitor for FTDI 3.3
* Added SJ for arduino compatibility.
=== 7.0 ===
* Initial public release
== Media ==
[[File:Afb000.jpg|left|thumb|FTDI-Atmega Development Board programmed with Arduino software, used for temperature control on the curing process of an aircraft repair.]]
0154780da7d6ab2ba091abf8c1cbe501203c257f
Usbbigmultio
0
5
3398
351
2015-11-02T11:14:54Z
Cartridge1987
2553
/* USB IO */
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USB bigmultio PCB.
The USB bigMultio PCB can be bought in the [http://www.bitwizard.nl/shop/avr-boards/raspduino BitWizard shop].
== Overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/7766S.pdf ATmega16/32U4 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
== Pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Future hardware enhancements ==
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 1.1 ===
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
=== 1.0 ===
* Initial release
3a916fbeee942ae55146711d87ad44f62dca7433
USB-multio
0
46
3399
2728
2015-11-02T11:18:55Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.<br>
The USB-Multio PCB can be bought in the [http://www.bitwizard.nl/shop/avr-boards/usb-multio-21 BitWizard shop].
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
For software development, implmenting USB communication we recommend LUFA:
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
45d9ca8e4af91c19f74150584b361dc031d23e54
3401
3399
2015-11-02T11:21:24Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.<br>
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
For software development, implmenting USB communication we recommend LUFA:
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
15f39393048372717f191eb53b96da69599ddde6
3402
3401
2015-11-02T11:21:45Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
The USB-Multio PCB can be bought in the [http://www.bitwizard.nl/shop/avr-boards/usb-multio-21 BitWizard shop].
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.<br>
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
For software development, implmenting USB communication we recommend LUFA:
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
eca5f72c249fc5d42417c0fba1763788ef4a75a5
3403
3402
2015-11-02T11:22:06Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
That can be bought in the [http://www.bitwizard.nl/shop/avr-boards/usb-multio-21 BitWizard shop].
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.<br>
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
For software development, implmenting USB communication we recommend LUFA:
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
4a5cae195722729b5e1fa5f1f83ddaa5ecbe117f
FT201X
0
1716
3400
2954
2015-11-02T11:21:05Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT201X.jpg|thumb|300px]]
This is the documentation page for the FT201X breakout board.
The FT201X breakout board can be bought at the [http://www.bitwizard.nl/shop/breakout-boards/ft201x-breakout-board BitWizard shop].
== overview ==
The FT201X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT201X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT201X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT201X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>SCL</td><td>SDA</td></tr>
<tr><td>CBUS5</td><td>CBUS4</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
56f09d47af29e1131e5aabc40ed3ccc345ed9b2d
3404
3400
2015-11-02T11:22:22Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT201X.jpg|thumb|300px]]
This is the documentation page for the FT201X breakout board.
The FT201X breakout board can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft201x-breakout-board BitWizard shop].
== overview ==
The FT201X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT201X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT201X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT201X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>SCL</td><td>SDA</td></tr>
<tr><td>CBUS5</td><td>CBUS4</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
dc5e43599e80ab2966d347a6ae96697fee4d47fa
FT220X
0
1717
3405
2953
2015-11-02T11:23:26Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT220X.jpg|thumb|300px]]
This is the documentation page for the FT220X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft220x-breakout-board BitWizard shop].
== overview ==
The FT220X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT220X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT220X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT220X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>MIOSI2</td><td>MIOSI3</td></tr>
<tr><td>MIOSI0</td><td>MIOSI1</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
Please note: On version 1.1 of the boards, the silkscreen markings for MIOSI1 and MIOSI3 are switched!
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
9d61d1d14eb9edd937b0927e69f6355bec9312e0
FT221X
0
1718
3406
2955
2015-11-02T11:24:24Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT221X.jpg|thumb|300px]]
This is the documentation page for the FT221X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft221x-breakout-board BitWizard shop].
== overview ==
The FT221X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT221X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT221X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT221X.html FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>MIOSI7</td><td>MIOSI6</td></tr>
<tr><td>MIOSI5</td><td>MIOSI4</td></tr>
<tr><td>MIOSI3</td><td>MIOSI2</td></tr>
<tr><td>MIOSI1</td><td>MIOSI0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
feffbc7f9880fb9ea28ceca23b4706941d0a1f0a
FT230X
0
1719
3407
2956
2015-11-02T11:25:22Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT230X.jpg|thumb|300px]]
This is the documentation page for the FT230X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft230x-breakout-board BitWizard shop].
== overview ==
The FT230X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT230X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT230X.html FTDI product page]
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>CTS#</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The board is equipped with a power-LED, an Rx-LED and a Tx-LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
efc318b78205c99e3177dfef0ea10757e91647d4
FT231X
0
1720
3408
2957
2015-11-02T11:26:17Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT231X.jpg|thumb|300px]]
This is the documentation page for the FT231X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft231x-breakout-board BitWizard shop].
== overview ==
The FT231X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT231X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT231X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT231X.html FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>RI#</td><td>DCD#</td></tr>
<tr><td>DSR#</td><td>DTR#</td></tr>
<tr><td>CTS#</td><td>RTS#</td></tr>
<tr><td>RXD</td><td>TXD</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
38df6436cc0096b2de7b2828c3ae0ad300ad9c87
FT240X
0
1721
3409
2958
2015-11-02T11:26:51Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT240X.jpg|thumb|300px]]
This is the documentation page for the FT240X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft240x-breakout-board BitWizard shop].
== overview ==
The FT240X breakout board has an USB connector, one 20-pin IO connector. The brains of the PCB, of course, is an FT240X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT240X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT240X.html FTDI product page]
== pinout ==
The 20-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>VCCIO(jumpered)</td><td>DATA0</td></tr>
<tr><td>DATA1</td><td>DATA2</td></tr>
<tr><td>DATA3</td><td>DATA4</td></tr>
<tr><td>DATA5</td><td>DATA6</td></tr>
<tr><td>DATA7</td><td>RXF#</td></tr>
<tr><td>TXE#</td><td>RD#</td></tr>
<tr><td>WR#</td><td>SI/WU#</td></tr>
<tr><td>CBUS5</td><td>CBUS6</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The only jumper Is for selecting the I/O voltage. 1-2 = 1V8, 2-3 = 3V3.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
4b9932c382336fe9e0b4a9c38cbb3ab21fe4a2f9
FT245RL V1.5
0
1724
3410
2959
2015-11-02T11:27:26Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT245RL.jpg|thumb|300px]]
This is the documentation page for the FT245RL breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft245rl-breakout-board BitWizard shop].
== overview ==
The FT245RL breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT245R.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT245R.htm FTDI product page]
== pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>TXE#</td><td>RXF#</td></tr>
<tr><td>RD#</td><td>WR</td></tr>
<tr><td>D7</td><td>D5</td></tr>
<tr><td>D5</td><td>D4</td></tr>
<tr><td>D3</td><td>D2</td></tr>
<tr><td>D1</td><td>D0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The only jumper is for selecting the I/O voltage. Place the jumper on the left side for 3V3, or on the right side for 5V.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
64bcd5eeb78926ac45be6677254cda95af615c2f
FT311D
0
1722
3411
2979
2015-11-02T11:28:20Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT311D.jpg|thumb|300px]]
This is the documentation page for the FT311D breakout board. The can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft331d-breakout-board BitWizard shop].
== overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
ccd7ec130522f48f50eda2e589dd4e8459ceb0be
FT312D
0
1723
3412
3036
2015-11-02T11:29:28Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board. (FT 312 D to help people like me find it with the search function). <br> The FT312D breakoutboard you can buy in the [http://www.bitwizard.nl/shop/breakout-boards/ft312d-breakout-board BitWizard shop].
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
7b45f225997113af199085e518dca7fdcc71884d
3413
3412
2015-11-02T11:29:57Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board. (FT 312 D to help people like me find it with the search function). <br> The FT312D breakout board can you buy in the [http://www.bitwizard.nl/shop/breakout-boards/ft312d-breakout-board BitWizard shop].
== overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
431bc70cbb6be483e5ab900543135ced0a4bec67
FT4222h
0
1756
3414
3053
2015-11-02T11:30:32Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board. That you can buy in the [http://www.bitwizard.nl/shop/breakout-boards?product_id=150 BitWizard shop].
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
<TODO>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors. This is a solder jumper. We default the jumper to 5V with a small trace on the PCB.
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
0cbac826b6de776a9cd012c54e0dc34655ca4ab2
Raspberry Pi Serial
0
59
3415
2892
2015-11-02T11:32:14Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
You can buy the Raspberry Pi Serial board in the [http://www.bitwizard.nl/shop/breakout-boards/serial-bob BitWizard shop].
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
=== signal levels ===
Many expansion boards that you might want to connect to your raspberry pi will be 5V, whereas the Raspberry Pi works at 3.3V. To convert the signal levels you need a level shifter.
For I2C the board implements a level shifter as recommended by Philips (inventor of I2C).
For SPI and UART the 3.3V signals coming out of the Raspberry Pi are sufficiently high that all 5V devices that we could find recognized the signal as high. For the 5V signals going to the Raspberry Pi, we have limited the voltage to just above 3.3V by putting a scottky diode from the signal to the 3.3V, as well as a 1k resistor to limit the current. This sufficiently protects the raspberry pi from damage by the 5V signals from 5V devices.
Some care should be taken: The 5V device should NOT drive the signals that are normally driven by the raspberry pi. Normally you'd have two outputs driving against eachother, now there is also the 5V vs 3.3V issue....
== Pinout ==
The 26 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools .
git clone https://github.com/rewolff/bw_rpi_tools.git
Now, you can use the tools in either the SPI or I2C subdirectory to communicate with bitwizard SPI or I2C boards that you might have.
== getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== changelog ===
* Initial public release
9ca15179972ee03109ddbebc4e89f8f4ae3c768a
3416
3415
2015-11-02T11:34:18Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
You can find the Raspberry Pi Serial board in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=Bob BitWizard shop].
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
=== signal levels ===
Many expansion boards that you might want to connect to your raspberry pi will be 5V, whereas the Raspberry Pi works at 3.3V. To convert the signal levels you need a level shifter.
For I2C the board implements a level shifter as recommended by Philips (inventor of I2C).
For SPI and UART the 3.3V signals coming out of the Raspberry Pi are sufficiently high that all 5V devices that we could find recognized the signal as high. For the 5V signals going to the Raspberry Pi, we have limited the voltage to just above 3.3V by putting a scottky diode from the signal to the 3.3V, as well as a 1k resistor to limit the current. This sufficiently protects the raspberry pi from damage by the 5V signals from 5V devices.
Some care should be taken: The 5V device should NOT drive the signals that are normally driven by the raspberry pi. Normally you'd have two outputs driving against eachother, now there is also the 5V vs 3.3V issue....
== Pinout ==
The 26 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools .
git clone https://github.com/rewolff/bw_rpi_tools.git
Now, you can use the tools in either the SPI or I2C subdirectory to communicate with bitwizard SPI or I2C boards that you might have.
== getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== changelog ===
* Initial public release
b324d19cba094f7d7cbd9fc5ae17444beb478b7c
LCD
0
716
3417
2503
2015-11-02T11:37:13Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards. That you can buy in the [http://www.bitwizard.nl/shop/displays/lcd-interface-16x2 BitWizard shop].
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
The contrast setting depends strongly on the voltage of the power line. We test the boards with our powersupply and deliver them with a contrast setting that works for us. However if your powersupply has a higher or lower voltage, the proper contrast setting might be different.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with the raspberry pi use the [https://github.com/rewolff/bw_rpi_tools bw_rpi_tools package from github](and then only the bw_tool program).
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[lcd protocol 1.6]] (both I2C and SPI).
For reference: here are older versions of the document: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
d9cb365831d3a0b3b1c47f60e42896cc5e8d5e2e
3418
3417
2015-11-02T11:38:04Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards. That you can buy in the [http://www.bitwizard.nl/shop/displays BitWizard shop].
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
The contrast setting depends strongly on the voltage of the power line. We test the boards with our powersupply and deliver them with a contrast setting that works for us. However if your powersupply has a higher or lower voltage, the proper contrast setting might be different.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with the raspberry pi use the [https://github.com/rewolff/bw_rpi_tools bw_rpi_tools package from github](and then only the bw_tool program).
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[lcd protocol 1.6]] (both I2C and SPI).
For reference: here are older versions of the document: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
926283e605f6233a0126bf81b514e627b5e393a8
3FETs
0
483
3419
3326
2015-11-02T11:40:49Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards. That you van buy in the [http://www.bitwizard.nl/shop/expansion-boards/3fets BitWizard shop].
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering the 3FETs board ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
ab8977d8c13052362690f041aea7abcd08106a37
3420
3419
2015-11-02T11:41:01Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/3fets BitWizard shop].
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering the 3FETs board ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
1907fd0e40e9bf22d12aefc2a4f53c0905440823
7FETs
0
49
3421
3361
2015-11-02T11:41:41Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
bb1efe84f7591e1f803b5aa221b0510123a49164
Relay
0
53
3422
3312
2015-11-02T11:43:00Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
You can buy the BigRelay board in [http://www.bitwizard.nl/shop/expansion-boards/bigrelay BitWizard shop].
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Controlling the relays of Relay or BigRelay ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8, 10, 20 for relays 1-6.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
Which method you use is up to you. If your program "knows" the state of all the relays, using register 0x10 may be easier. But if say you have one program controlling one relay and another program controlling another, using the 20-25 registers is probably easier.
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-1]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
ef60e484273d42ced5dd71038ceb07f22e6be15a
3423
3422
2015-11-02T11:43:14Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Controlling the relays of Relay or BigRelay ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8, 10, 20 for relays 1-6.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
Which method you use is up to you. If your program "knows" the state of all the relays, using register 0x10 may be easier. But if say you have one program controlling one relay and another program controlling another, using the 20-25 registers is probably easier.
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-1]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
3fad612b91adbeb15be2cffbf8c44846b2131f3f
3424
3423
2015-11-02T11:43:43Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
You can buy the BigRelay board in [http://www.bitwizard.nl/shop/expansion-boards/bigrelay BitWizard shop].
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Controlling the relays of Relay or BigRelay ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8, 10, 20 for relays 1-6.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
Which method you use is up to you. If your program "knows" the state of all the relays, using register 0x10 may be easier. But if say you have one program controlling one relay and another program controlling another, using the 20-25 registers is probably easier.
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-1]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
1658639eecff1e563e7f00614b3b2e044d6b362c
Dimmer
0
1695
3425
3110
2015-11-02T11:44:48Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found in [http://www.bitwizard.nl/shop/expansion-boards/bw-dimmer here] in the shop.
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
336f0cb8193c3e29580c13b34358833fde21bf8b
3426
3425
2015-11-02T11:45:03Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found [http://www.bitwizard.nl/shop/expansion-boards/bw-dimmer here] in the shop.
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
b62590fa5f8aa52226b50d0a2e14b76f5eac882b
DIO
0
52
3427
2786
2015-11-02T11:45:40Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/dio BitWizard shop].
== Overview ==
This board enables you to read and write up to 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as analog inputs!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! analog?
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0 || yes
|-
| 4 || IO1 || yes
|-
| 5 || IO2 || no
|-
| 6 || IO3 || yes
|-
| 7 || d.n.c.
|-
| 8 || IO4 ||yes
|-
| 9 || IO5 ||no
|-
| 10 || IO6 ||yes
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
249b272ba601462e7d880d5e51d135f09020dc5b
16 LEDs
0
54
3428
2552
2015-11-02T11:46:23Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/dio-leds BitWizard shop].
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards (e.g. i2c_dio or spi_dio). Or if your board has a 10x2 pin header, you can use a 20pin IDC cable.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
The 16-leds board can be ordered in two versions. The common-anode version will connect all the anodes to VCC (pin 19,20) and the leds via a resistor to the 16 inputs (pin 3-18). This means that the led will light up if you drive the input pin (3-19) LOW. This is useful for open collector outputs. However usually this results in inverted logic: the led lights when the signal is low.
Most people will want the common-cathode version. This connects all the cathodes to GND (pin 1/2) and then all the inputs to the leds. This results in normal logic: the leds light up if the signal is high.
=== testing ===
To test the 16LED, connect the GND (pin 1 or 2) to any of the GND pins on your board.
Next take a 5V (or 3.3V) wire (pin 2 on DIO) and connect it one at a time to pin 3, 4, and so on. You can use a power supply pin or a pin programmed to "high". Each time you touch one of the inputs, one of the leds should light up.
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
== Jumper settings ==
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND / kathode</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC / anode</td></tr>
</table>
== Future hardware enhancements ==
The jumper is not much use: If you have the common cathode version the jumper must connect the common rail to GND, and if you have the common anode version, you must connect it to VCC. Therefore it makes more sense to make this a solder-jumper. It makes sense to design the board to have the GND signal the default because most people will want the normal-logic version i.e. the common cathode.
== Changelog ==
=== 2.0 ===
* Initial public release
9f023262dcb92728a51348eacf89fe46e1cf7683
I2C splitter
0
1683
3429
3075
2015-11-02T11:47:47Z
Cartridge1987
2553
wikitext
text/x-wiki
The I2C can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/i2c-splitter-PCA9548A BitWizard shop].
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
[[File:Dsc05850_edit.jpg|thumb|500px|alt=The annotated i2c_splitter board|The i2c_splitter board]]
The "Vout" connector provides GND/AUX/VCC. By placing a jumper on AUX/VCC, you can configure your slave I2C busses to use the same power supply as your main VCC (usually 5V or 3.3V). If you require a different voltage, you can apply that voltage using a two-pin connector using GND/AUX on the same connector. If you ordered the special version prepared for a specific output voltage, no connection/jumper is necessary on the VOUT connector. You can measure the output voltage on the AUX pin if you want (there are 8 other pins that make this voltage available, but it's there. :-) )
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your master is 5V and your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
9f93c7f97b0a5b41c8cce7a101d010d501ccd09a
3430
3429
2015-11-02T11:47:59Z
Cartridge1987
2553
wikitext
text/x-wiki
The I2C splitter can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/i2c-splitter-PCA9548A BitWizard shop].
= general info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
[[File:Dsc05850_edit.jpg|thumb|500px|alt=The annotated i2c_splitter board|The i2c_splitter board]]
The "Vout" connector provides GND/AUX/VCC. By placing a jumper on AUX/VCC, you can configure your slave I2C busses to use the same power supply as your main VCC (usually 5V or 3.3V). If you require a different voltage, you can apply that voltage using a two-pin connector using GND/AUX on the same connector. If you ordered the special version prepared for a specific output voltage, no connection/jumper is necessary on the VOUT connector. You can measure the output voltage on the AUX pin if you want (there are 8 other pins that make this voltage available, but it's there. :-) )
= jumpers =
== address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your master is 5V and your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
8ef1eb870812aff593c94b82e177e00d59a3b583
Motor
0
658
3431
2575
2015-11-02T11:50:25Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board. That can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/motor BitWizard shop].
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 10V to 14V power supply. Please refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2. The motor voltage is used to drive the FETs
|-
| >14V || Jumper on pins 2 and 3. The onboard regulator generates 12V from the motor voltage.
|}
If a FET is built to use 12V gate voltages, it will only conduct partially when you drive it with lower voltages. The FET would run hot or self-destruct very quickly if that happens. So to prevent this from happening the FET-driver will not drive the FET at all if the gate-drive-voltage is not above 8V. That is why even if your motor runs on 5V you cannot use 5V for the gate-drive-voltage.
=== LEDs ===
The only LED is a power LED.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
7e86f5f3052139e6e021ec6d3061ca931717985e
User Interface
0
1505
3432
3130
2015-11-02T11:52:58Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board. That can be found in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=user%20interface BitWizard shop].
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just use:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
66a1eb61d532c43b40abfd6836e32d2733f61fa5
Relay
0
53
3433
3424
2015-11-02T11:56:22Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
The Relay board can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/relay BitWizard Shop].
The BigRelay board can be bought here in the [http://www.bitwizard.nl/shop/expansion-boards/bigrelay BitWizard shop].
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Controlling the relays of Relay or BigRelay ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8, 10, 20 for relays 1-6.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
Which method you use is up to you. If your program "knows" the state of all the relays, using register 0x10 may be easier. But if say you have one program controlling one relay and another program controlling another, using the 20-25 registers is probably easier.
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-1]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
06de1ac21b548f45a3680cd5495eee1017bcbf34
3434
3433
2015-11-02T11:56:44Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_relay.jpg|thumb|300px|alt=The SPI_relay board|The SPI_relay board]]
[[File:bigrelay.jpg|thumb|300px|alt=The BigRelay board| The BigRelay board]]
This is the documentation page for the I2C/SPI Relay and BigRelay boards.
The Relay board can be bought here in the [http://www.bitwizard.nl/shop/expansion-boards/relay BitWizard Shop].
The BigRelay board can be bought here in the [http://www.bitwizard.nl/shop/expansion-boards/bigrelay BitWizard shop].
== Overview ==
The Relay board allow you to drive two relays, while the BigRelay board can drive six relays. Both of the boards have a I2C and SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the relay PCB do things, you need to send things over the SPI bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the relay PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The address of the BigRelay was incorrectly documented at first. The correct address is 0x9c.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and relay boards as well.
== Jumper settings ==
The Bigrelay has a jumper on the right side of the board. It is usually marked "SV1". The pinout is as follows:
* 3 - +5V from SPI/I2C (marked "5V")
* 2 - 5V for the relays (marked "aux 5V")
* 1 - GND (marked GND)
This allows you to use the SPI/I2C 5V by installing a jumper on 2-3, or use an external powersupply by connecting the powersupply GND to pin 1 and the 5V from the powersupply to pin 2.
== Additional Considerations ==
Each relay draws about 70mA. This means that if you have the bigrelay board, and turn on all six relays, the current draw will amount to about 400mA. If you have the board connected to a Raspberry Pi, this might stress your polyfuse on the 5V line, and/or exceed the capabilities of your powersupply. You can supply extra 5V power on the 5V lines of other connectors on the board. For example, if you have the SPI version, you can mount one of the I2C connectors and provide GND and 5V on pin 1 and 4 respectively.
Note that your extra powersupply is likely to start powering the Raspberry Pi a bit as well. (Due to the voltage drop over the polyfuse in the Raspberry Pi, the 5V on the relay board is likely to be a bit higher than that what ends up on the Pi itself.) You could consider powering the whole system through this extra powersupply, but be careful, the polyfuse on the Pi is now circumvented.
On the other hand, on the newer bigrelay boards, you can provide the power for the relays on SV1 as described above.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power Consumption ==
Each relay typically consumes about 55mA. Max 70mA. So for a bigrelay with all relays "on" you need to arrange for about 400mA of power. The board uses about 8mA when idle (typ).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
| colspan="3"| Only for BigRelay:
|-
| 7 || NO || Normally open contact for relay 3
|-
| 8 || C || center connection for relay 3
|-
| 9 || NC || normally closed contact for relay 3
|-
| 10 || NO || Normally open contact for relay 4
|-
| 11 || C || center connection for relay 4
|-
| 12 || NC || normally closed contact for relay 4
|-
| 13 || NO || Normally open contact for relay 5
|-
| 14 || C || center connection for relay 5
|-
| 15 || NC || normally closed contact for relay 5
|-
| 16 || NO || Normally open contact for relay 6
|-
| 17 || C || center connection for relay 6
|-
| 18 || NC || normally closed contact for relay 6
|-
|}
== Controlling the relays of Relay or BigRelay ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8, 10, 20 for relays 1-6.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #Relay 1 on
bw_tool -s 50000 -a 9c -W 10:20:b #Relay 6 on
You can use register 20 till 25 to turn every single relay on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #Relay 1 off
bw_tool -s 50000 -a 9c -W 25:1:b #Relay 6 on
Which method you use is up to you. If your program "knows" the state of all the relays, using register 0x10 may be easier. But if say you have one program controlling one relay and another program controlling another, using the 20-25 registers is probably easier.
== LEDs ==
There is one power led.
On the regular relay board are two LEDs near each of the relays indicating the state of the relays. The BigRelay board doesn't have indication LEDs.
== Related projects ==
* [[Temperature_control]]
== External resources ==
=== Datasheets ===
5A variant: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A variant: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE-1]
== Additional software ==
[[bw_tool]]
== Changelog ==
=== 1.0 ===
* Initial public release
82a95a82712198b801f973b85d58f5023b70ab48
Servo
0
50
3435
2678
2015-11-02T11:57:23Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_Servo.jpg|thumb|300px|alt=The SPI_Servo PCB|The Servo PCB (SPI version photographed)]]
This is the documentation page for the SPI_servo and I2C_SERVO boards. That can you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/servo BitWizard shop].
== Overview ==
This module enables you to easily control upto 7 servomotors over an SPI or I2C interface, while needing minimal resources from your CPU.
The PCB is equipped with two SPI or I2C connectors, so daisychaining multiple SPI or I2C modules is possible.<br>
This allows you to control a chain of boards with only 4 data lines (MOSI, MISO, SS and SCK) for SPI or two lines (SDA, SCL) for I2C. This is not only pin-saving, but is is also possible do daisy-chain multiple modules (we will be releasing even more boards with other functions in the very near future)!<br>
The board can be used with all microcontrollers, such as the Atmel AVR, Arduino/Freeduino boards, Microchip PIC, Raspbery PI etcetera. <br>
<br>
For small servos, the power supplied by the SPI or I2C connector is enough. However current surges of up to a whole ampere are easily achieved even when two or three smaller servos need to move simultaneously. For larger servos however, the voltage drop may be to high. We suggest conneting an auxillary 5V power source to the PCB, and move the jumper.
== External resources ==
=== Datasheets ===
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
for the I2C connector see: [[I2C_connector_pinout]]
The pinout is standard for servo-motors;
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || Servo || PWM data.
|-
|}
Pin one is located closest to the side of the board.
Besides the seven servo outputs, there is an eighth header:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || VCC || 5V
|-
| 3 || - || No pin
|-
|}
This can be used to provide power to the servos. For example, mosts ESCs have a BEC on board. These would fit on this connector, leaving the PWM signal pin unconnected.
Recent versions of the board allow you to disconnect the servo-power from the SPI (or I2C) bus power. Allowing you to keep the "clean" 5V for the raspberry pi and the "dirty" 5V for the servos separate.
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || 5Vservo || 5V for the servos
|-
| 3 || 5V bus || 5V from the SPI or I2C bus.
|-
|}
The idea here is that you can connect your powersupply ground and 5V on 1-2, or a jumper on the 2-3 position to power the servos from the bus.
Keep in mind that even a small 9g servo will draw at least 500mA when you tell it to "suddenly" change position. So if your powersupply isn't powerful enough, 7 servos going to a new position may crash your BitWizard Servo board, or even your raspberry pi.
=== LEDs ===
One LED is the normal power-LED. It is powered from the serial-bus-5V.
The other led, next to the servo connectors, shows you the status of the 5V that powers the servos. If for example, you forget to connect the jumper (2-3) for bus-powered servos, the led will show you that.
== Jumper settings ==
Solder jumper (on bottom layer): ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: Both SPI connectors connected in parallel.<br>
2-3: ICSP enabled; programming the MCU over the 6-pin connector. This connector may be marked SPI1 or SPI3 (near the edge of the board, furthest from the CPU.)<br>
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Servo_1.0_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for SERVO boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.2 ===
* Added jumper/power connector for (external) servo power.
=== 1.0 ===
* Initial public release
1809c4f9d90fa28e330d2ef1f90e9c446088e253
Temperature Interface
0
51
3436
3077
2015-11-02T11:57:57Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/temp-interface BitWizard shop].
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== examples ==
The folowing script
#!/bin/sh
# Sample script to read and calculate a temperature.
#
# for I2C:
TEMPBRD="bw_tool -I -D /dev/i2c-1 -a 8c"
# for SPI:
#TEMPBRD="bw_tool -a 8c"
#
if [ x"$1" = x"--init" ] ; then
# First initialize the temperature sensor.
# Channel 0 is first sensor, ... channel 3 is last sensor, sample four channels,
# add 64 (0x40) samples, and then... don't shift
$TEMPBRD -W 70:81:b 71:80:b 72:82:b 73:83:b 80:4:b 81:40:b 82:0:b
# wait for the settings to apply and enough sampes to be taken.
sleep 1
fi
adcconversion=`$TEMPBRD -1 -R 68:s`
# This value is scaled to 65535 is 1.1V.
# So:
# (1) voltage = adcconversion * 1.1 / 65535
# For the MCP9700 temperature sensor:
# (2) voltage = 0.5V + temp * 0.010V/C
# Some reworking results in:
# (3) temp = (voltage - 0.5)/0.01
# Now we can substitute the voltage from (1) and get:
# (4) temp = 100 * (adcconversion * 1.1 / 65535 - 0.5)
# and reworking this we get:
# (5) temp = .001678 * adcconversion - 50
temp=`echo $adcconversion \* .001678 - 50 | bc -l`
echo "temperature is: $temp"
will initialize all four channels if you pass it --init and then read out just the first. On the adcconversion= ... line you need to change to 69 for the second sensor, 6a for the third and 6b for the last.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c73e2a9c3c1285e6b9a39dc8b16a303666960bf4
USB-opto
0
8
3437
142
2015-11-02T12:02:40Z
Cartridge1987
2553
/* USB-opto */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-optocoupler BitWizard shop].
== overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
19ef5dd0677a13d2287ab9048f637d65cc90f6c1
USB Relay
0
1678
3438
3056
2015-11-02T12:03:25Z
Cartridge1987
2553
/* intro */
wikitext
text/x-wiki
== intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
You can buy the USB Relay in the [http://www.bitwizard.nl/shop/usb-boards/usb-relay BitWizard shop].
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound. This has not been converted to a BAT file for windows yet.
For Windows users, there is an INF file in the zipfile. Tell windows that this is the driver for your device, and it will use the builtin driver to create a virtual comport. The "usbr.bat" script assumes this has become "COM3", but it could be a higher number. If so, you can adjust the script and change the default to whatever your comport has become, or use an environment variable. IIRC, you can add something like "set relayport=COM5" to your c:\autoexec.bat . It has been a long time since I worked with Windows. Please let me know if this works.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyACMx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
51b0bc466dd04f60e1b30afea3d6bb703b9aab86
USB-SATA powerswitch
0
7
3439
3011
2015-11-02T12:04:25Z
Cartridge1987
2553
/* USB SATA powerswitch */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
You can buy the USB SATA powerswitch in the [http://www.bitwizard.nl/shop/usb-boards/usb-sata-powerswitch BitWizard shop].
== overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
b9040fe3369ef73b805515d246798c6bd4a56979
FTDI serial 2
0
625
3440
1082
2015-11-02T12:05:01Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial 2 board. That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-uart-ftdi BitWizard shop].
== overview ==
The FTDI-serial 2 board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
<tr><td>4</td><td>VCC (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (place jumper near FTDI)<br>
2-3: 5V (place jumper near UART header)<br>
== future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
c44f82f4cea25dcb62e69b93264aff195d0d150c
Blog 15
0
1817
3441
3392
2015-11-04T14:03:02Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
static long Rot = 0x200;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
eadaf3169523710b2bde198e08a40c30e2b6268b
3442
3441
2015-11-04T14:54:11Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
b1d49d89bf259110c617af80a2f262a6d7d54831
3443
3442
2015-11-04T14:55:32Z
Cartridge1987
2553
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
2030d1900bdb5894c342059cb0d95f7b014fb1a8
3444
3443
2015-11-04T14:55:47Z
Cartridge1987
2553
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>32);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
09d325480239439086f609923ea80d6b5a3fcce4
3445
3444
2015-11-04T15:03:06Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
13c94952d81bb85409db29e049bd658ff383f6d3
3446
3445
2015-11-04T15:22:12Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
40acf6eae5f43ec5544febce67388d345f598fb4
3447
3446
2015-11-04T15:36:34Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
d9a27d204e2b87e5d8e90ba4e191a5e2c9ec70b2
3449
3447
2015-11-04T16:10:46Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
ee07971d92e7f55fa9774a8e2a9108b7e61d6adf
File:Rasp7fetsStepper.jpg
6
1819
3448
2015-11-04T16:08:48Z
Cartridge1987
2553
The Stepper motor connected with a 7fets that is connected with the Raspberry pi.
wikitext
text/x-wiki
The Stepper motor connected with a 7fets that is connected with the Raspberry pi.
0ea4a881eae16421ec00aa935bce942effe60f1a
DIO
0
52
3450
3427
2015-11-05T13:10:57Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/dio BitWizard shop].
== Overview ==
This board enables you to read and write up to 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as [http://www.bitwizard.nl/wiki/index.php/Analog_inputs analog inputs!]
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! analog?
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0 || yes
|-
| 4 || IO1 || yes
|-
| 5 || IO2 || no
|-
| 6 || IO3 || yes
|-
| 7 || d.n.c.
|-
| 8 || IO4 ||yes
|-
| 9 || IO5 ||no
|-
| 10 || IO6 ||yes
|}
=== LEDs ===
The only LED is a power indicator.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
09c239417ffcabd6b8f4c41147eee1d346f46cc7
3470
3450
2015-11-06T10:14:46Z
Cartridge1987
2553
/* jumper settings */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/dio BitWizard shop].
== Overview ==
This board enables you to read and write up to 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as [http://www.bitwizard.nl/wiki/index.php/Analog_inputs analog inputs!]
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! analog?
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0 || yes
|-
| 4 || IO1 || yes
|-
| 5 || IO2 || no
|-
| 6 || IO3 || yes
|-
| 7 || d.n.c.
|-
| 8 || IO4 ||yes
|-
| 9 || IO5 ||no
|-
| 10 || IO6 ||yes
|}
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
32c58f5fc6420e1845dc19567f055790975c5bb2
File:Thermocouple.jpg
6
1820
3451
2015-11-05T13:41:39Z
Cartridge1987
2553
The BitWizard Thermocouple.
wikitext
text/x-wiki
The BitWizard Thermocouple.
a6df78039d090a32184886a33d3f068c75186b25
Thermocouple
0
1821
3452
2015-11-05T13:50:06Z
Cartridge1987
2553
Created page with "[[File:Thermocouple.jpg|thumb|300px|The Thermocouple]] This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-bo..."
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
765c82b5dd4365a8c0d5c3357cb58013cfaf2502
3453
3452
2015-11-05T13:57:38Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
837dd906aece0362f7c409b8362daff2be34784d
3455
3453
2015-11-05T14:48:47Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== See also ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]
87d2601864d40ddea1182e9089b9fe5c46c6933a
3456
3455
2015-11-05T14:59:26Z
Cartridge1987
2553
/* See also */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== See also ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]
90ef9530db61bf5518b45a390295017a19a735cf
3457
3456
2015-11-05T15:00:47Z
Cartridge1987
2553
/* See also */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== See also ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]
9777320bbdaaa7838b5e3985dc39c9099b5585b5
3458
3457
2015-11-05T15:04:54Z
Cartridge1987
2553
/* See also */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
86f249caef520ac89c4863fe600c17bd683ec9ec
3467
3458
2015-11-05T16:30:37Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
71b01f37294844fe1b1cc247a1e63b6a912735af
3468
3467
2015-11-05T16:32:23Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
== THIS WIKI IS WORK IN PROGRESS ==
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
64b32d06e81a9b2c93ecc834ba086ec3db1e6a34
3469
3468
2015-11-06T08:37:15Z
Cartridge1987
2553
/* THIS WIKI IS WORK IN PROGRESS */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
6220bf6c2a8e504a4564d04d3cb7098412a86a54
3472
3469
2015-11-06T10:35:03Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact] us: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the Thermocouple be useful, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the Thermocouple PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the Thermocouple board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and Thermocouple boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
436b5ac4e298583745d2f48632be476cfa185f2f
3473
3472
2015-11-06T11:08:33Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering Thermocouple ==
Although some BitWizard boards will work with 3.3V as the power supply, the Thermocouple board needs to be supplied with 5V as this voltage is used to drive.
== Protocol ==
To make the Thermocouple be useful, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the Thermocouple PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the Thermocouple board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and Thermocouple boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
983a1bfd7e202226068a48ae344151c8bde5cb6f
3474
3473
2015-11-06T11:17:26Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The Thermocouple has a low voltage of 75mV. The low voltage is temperature sensitive, so that makes it possible to read the temperature with it.
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering Thermocouple ==
Although some BitWizard boards will work with 3.3V as the power supply, the Thermocouple board needs to be supplied with 5V as this voltage is used to drive.
== Protocol ==
To make the Thermocouple be useful, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the Thermocouple PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the Thermocouple board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and Thermocouple boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
c8bb2447a64067ed54f7a9bb7c68a7854e742855
3475
3474
2015-11-06T11:31:22Z
Cartridge1987
2553
/* Pinout */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The Thermocouple has a low voltage of 75mV. The low voltage is temperature sensitive, so that makes it possible to read the temperature with it.
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! thermo
|-
| 0x00 || T4
|-
| 0x01 || T3
|-
| 0x02 || T2
|-
| 0x03 || T1
|-
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
More info you can read at [[analog inputs]].
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering Thermocouple ==
Although some BitWizard boards will work with 3.3V as the power supply, the Thermocouple board needs to be supplied with 5V as this voltage is used to drive.
== Protocol ==
To make the Thermocouple be useful, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the Thermocouple PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the Thermocouple board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and Thermocouple boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
5e7059c47f4c5cb3af79d500ca7d86c1f6d6f9d3
7FETs
0
49
3454
3421
2015-11-05T14:45:42Z
Cartridge1987
2553
/* powering 7fets */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact us]: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
cc51ec4f53135c6dd8ed5894c05760acacbfe27b
3459
3454
2015-11-05T15:10:34Z
Cartridge1987
2553
/* Changelog */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact us]: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/7fets The 7FETs BitWizard shop page]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
f0768df03f4807dacadb5f2956e88c03b1be995a
3460
3459
2015-11-05T15:12:10Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact us]: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/7fets The 7FETs BitWizard shop page]<br>
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs datasheet]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
c057ad3a2af6f282abb59db1fbdacf9f53cce02f
3461
3460
2015-11-05T15:28:27Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact] us if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact us]: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/7fets The 7FETs BitWizard shop page]<br>
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs datasheet]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
53d8f48823987a1ec8ed31298fd855706729381a
3463
3461
2015-11-05T16:10:33Z
Cartridge1987
2553
/* Overview */
wikitext
text/x-wiki
[[File:SPI_6FETs.jpg|thumb|300px|alt=The 7FETs PCB|The 7FETs PCB (SPI version)]]
This is the documentation page for the SPI_7FETs and I2C_7FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/7fets BitWizard shop].
== Overview ==
The board has 7 fets that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the powersupply.
About 1A per output should be possible. Maximum voltage is 20V. [http://www.bitwizard.nl/contact.php Contact us] if you require a larger voltage.
You will have to provide your own protection circuits (freewheeling diodes) if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 7FETS board is capable of sinking about 1A per output. We have tested 1.25A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A as the contacts of the connectors are not rated for so much, also the PCB is not equipped for such large currents. But if you need to drive several loads in sequence 1A per port is comfortably possible.
The manufacturer specifies the maximum current for the case where each fet has the whole board available as a heatsink.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || DEV POWER ||
|-
| 2 || OUT0 ||
|-
| 3 || DEV POWER ||
|-
| 4 || OUT1 ||
|-
| 5 || DEV POWER ||
|-
| 6 || OUT2 ||
|-
| 7 || DEV POWER ||
|-
| 8 || OUT3 ||
|-
| 9 || DEV POWER ||
|-
| 10 || OUT4 ||
|-
| 11 || DEV POWER ||
|-
| 12 || OUT5 ||
|-
| 13 || DEV POWER ||
|-
| 14 || OUT6 ||
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
You can chose two configurations: You can use pin 1-2 as ground and power. You can connect up to 15V (*) to pin 2 referenced to GND on pin 1.
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering 7fets ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs. If you need operation at 3.3V, [http://www.bitwizard.nl/contact.php contact us]: we can find FETs to populate the boards with that work at 3.3V.
== Protocol ==
To make the 7FETS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the 7fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 7fets board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 7fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/7fets The 7FETs BitWizard shop page]<br>
[http://www.irf.com/product-info/datasheets/data/irfml8244pbf.pdf The FETs datasheet]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
813b77bad3adfbb33c40450fbbf7ccf9201006a7
Analog inputs
0
1593
3462
2537
2015-11-05T15:42:11Z
Cartridge1987
2553
/* analog inputs */
wikitext
text/x-wiki
= Analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== Reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== Normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x28 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x2a || 0x2e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
28f902a688118f900a9f82e0a62c3bd04b99f6bb
Main Page
0
1
3464
3129
2015-11-05T16:19:26Z
Cartridge1987
2553
/* Help! */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
61390bc87fe7f03f6d99d9ae8b053bc1212aa297
Beginners guide to SPI on Raspberry Pi
0
794
3465
3195
2015-11-05T16:20:20Z
Cartridge1987
2553
/* Troubleshooting */
wikitext
text/x-wiki
= Introduction =
In this guide, I will show you how to get SPI up and running on a Raspberry Pi, and how to control a SPI_LCD module. We will start from scratch, with a blank SD card.
= Required hardware =
* Raspberry Pi
* 4GB (or larger) SD card
* Power supply for your Raspberry Pi
* Ethernet cable and/or USB keyboard (network connectivity is required)
* SD-card reader
= Bitwizard hardware =
either:
* a set of:
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=69 RPi Serial Breakout board]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=90 SPI cable]
** [http://www.bitwizard.nl/catalog/product_info.php?products_id=89 SPI LCD]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=115 Raspberry Pi UI 16x2]
* [http://www.bitwizard.nl/catalog/product_info.php?cPath=34&products_id=123 Raspberry Pi UI 20x4]
Not necessary, but useful:
* Monitor with HDMI (or DVI and a HDMI-DVI adapter)
* HDMI cable
= Software we will be using =
* [http://www.raspberrypi.org/downloads/ The latest Raspbian "wheezy"] [http://downloads.raspberrypi.org/raspbian_latest.torrent Direct link]
* If you are using Windows: download putty.exe from [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html here]
Unpack the Raspbian image. I advise on making a separate directory for this project, and put all the files there.
= Preparing the SD card =
== Under Linux ==
First, we will flash the SD card with the Debian image. Plug your SD card in your favorite reader, and into your PC. My SD card became /dev/sdc on my laptop, your mileage may vary.<br>
Copy the image to your SD-card:
sudo dd if=2014-06-20-wheezy-raspbian.img of=/dev/sdc
This may take some time, depending on the speed of your SD card, and card reader.
== Under Windows ==
Download and extract [http://sourceforge.net/projects/win32diskimager/ Win32diskimager]. Connect the SD card to your computer and start Win32Diskimager. Select the drive and image and click 'Write'
= Connecting the hardware =
We recommend you have/buy the rpi_serial board. It breaks out the SPI and I2C busses of the Raspberry Pi. This allows you to use a simple straight through 4- (I2C) or 6-pin (SPI) cable to connect the Raspberry Pi to the LCD board. The cables are available from our shop as well.
Connecting the SPI version of the board to Raspberry Pi without any interface logic is not recommended: The LCD board needs to run at 5V because the HD44780 only works at 5V. The MISO line is then driven by the board at 5V level, which is said to shorten the life of the BCM2735 significantly.
The I2C version of the board can be wired directly to the rpi with four wires.
If you're using SPI, please use the spi0 port for now for the purpose of this tutorial.
For RPi UI users: simply connect the board with the gpio pins.
= First boot =
You might want to hook up your pi to a monitor, but I usually find that to much of a hassle. Hooking up your Pi to your network, however, is necessary.
Mount the RPi-serial board on your Pi, connect the SPI cable to the SPI0 port (mind the polarity!), and connect the other end of the SPI cable to your SPI_LCD module.<br>
Plug your freshly flashed SD card in your Pi, hook up power, and your Pi will boot.
The first time the RPi boots, it will boot into the Raspberry Pi Config Tool. If you have connected a keyboard, you should enable SSH under advanced settings, expand the SD card and reboot. Upon reboot, you should see a message like
"My network IP address is 192.168.1.116"
You could connect to the RPi using SSH (see below, recommended) or continue using the keyboard.
= Connecting to the Raspberry Pi Using SSH =
To connect the Raspberry Pi, we first need to know its IP-number. This can be found in a number of ways:
* Check your router for new devices in the network.
* Use a network scanner like Zenmap or Fing (on your smartphone)
If you figured out the IP, you can connect to the RPi:
* On Windows: start putty
* On Linux: ssh pi@IP where IP is the IP-address
The default username/password is pi/raspberry
= Installing the program =
When connected, everything needs to be setup for interfacing with the board. We use our own bw_upgrade script:
Get the script:
wget http://www.bitwizard.nl/software/bw_upgrade && chmod a+x bw_upgrade
Run the script (this may/will take some time):
sudo ./bw_upgrade
And now, it's time to play! Let's try to display our first text:
sudo bw_tool -a 94 -t 'Hello World!'
In case of I2C (check display when unsure):
sudo bw_tool -a 94 -I -D /dev/i2c-1 -t 'Hello World!'
If you did everything right, you now have "Hello world!" displayed on your LCD. Have a look at the [[Bw tool| the wiki page of bw_tool]], or the [https://github.com/rewolff/bw_rpi_tools/blob/master/bw_tool/bw_tool.c source of bw_tool].
(For users of the "rev 1" model B, you need i2c-0 instead of i2c-1. )
= Next steps =
The bw_tool program can also be used to control all of our other SPI boards, using the -a, -r, and -v switches.
sudo bw_tool -a <address of the board> -r <register> -v <value>
Let's try this with a SPI_LCD, by clearing the screen. The display is at address 82, the register is 0x10, and the value doesn't matter. Caveat: The address should be given in hex, but the register and value in decimal.
sudo bw_tool -a 82 -w 10:0
Now your display should be cleared. <br>
See also the [[bw_tool| bw_tool wiki page ]].
= Congratulations! =
If you managed to get everything in this how-to working, you should be able to control the entire range of BitWizard SPI boards. Good luck, and please show us your projects!
= Troubleshooting =
If you have any problems, please let us know, and we will do our best to help you resolve them. You can [http://www.bitwizard.nl/contact.php contact us], or post your problem in our [http://forum.bitwizard.nl/ forum.] We will respond as soon as we can.
d5564341eb115e88d39151378d8d62805f86ed03
Raspberry Relay
0
1708
3466
3321
2015-11-05T16:21:13Z
Cartridge1987
2553
/* Pinout */
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php contact us]: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
example:
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
The SPI version has a jumper block. The pins 1,2 are marked, 3-4 are not. 1 is topright, 2 is top-left if you have the silkscreen on the board right-side-up. 1(top right) is SPI_CS0, the opposite corner (4, bottom left) is SPI_CS1. These signals can be connected to the other two with a jumper. 3, bottom-right is "board SPI CS". 2 top-left is the embedded processor's reset line. Putting a jumper 1-3 along the right of the jumper block will allow you to access the board using rapsberry pi SPI0 bus. Putting the jumper 1-2 along the top of the jumper block will allow you to flash the onboard processor, should that be needed.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
768c1e6c3da6d28ca498ee90d444b473c825c34a
General SPI protocol
0
401
3471
780
2015-11-06T10:28:17Z
Cartridge1987
2553
wikitext
text/x-wiki
BitWizard expansion boards communicate using an SPI protocol.
SPI is a well-known synchronous protocol, but not very well standardized. Many implementations require a separate "CS" line to each chip connected to the SPI bus. The BitWizard implementation does not have this requirement. This allows us to daisy chain a large number of boards without requiring an extra pin for every board.
= Timing =
The slaves use an ATTINY44 processor. These have a hardware universal serial interface (USI) module that can be configured as "SPI slave". Many things however have to be processed in software. This means that some time is required between each byte. This time is 20 microseconds. This is the time between sucessive bytes, not the dead time between bytes.
You can choose a clock frequency that suits you. The maximum is 2MHz. At 2MHz, transmitting one byte takes 4 mircoseconds, so a delay of 16 microseconds between bytes is required.
At 0.625MHz, transmission of a byte takes 12.8 microseconds, so a delay between bytes of only 7.2 microseconds is required.
With new firmware written in assembly (or at least the interrupt handler routine) this might be improved.
= Protocol =
To send a sequence of bytes to the slave SPI device, the master starts by pulling the SS line low. All slaves are now primed to receive an "address" byte. Next the master sends the address byte.
After this the protocol in theory depends on which slave you are talking to. In practice so far it is convenient to make the slaves talk a similar protocol: the next byte specifies a "register" or "port" address. After this you can send data to that port or register.
If the data can be considered a "data stream" like with the SPI_LCD board, you can call it a "port". If there is just a single value, it is more common to call it a register.
7ef875bf809d639d2dfffd2bc240e1384a01c148
Raspduino
0
1572
3476
3396
2015-11-06T13:47:50Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/shop/avr-boards/raspduino BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
=== Setup ===
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
=== Running the Project ===
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example main.c written in Arduino Wiring can be found [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/wiring-blink/src/main.c here]. An AVR native version is also [https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/atmelavr-native-blink/src/main.c provided]. More can be found among the [https://github.com/ivankravets/platformio/tree/develop/examples/atmelavr-native-blink project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
== Useful links ==
[http://www.bitwizard.nl/shop/avr-boards/raspduino The Raspduino BitWizard shop page]
aa9eff4708829b71b46debd35d6a43ae414bfebc
Blog list
0
1798
3477
3251
2015-11-06T15:39:42Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
*[[Blog 01]] - Starting up the Raspberry Pi
*[[Blog 02]] - Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - Online weather station
*[[Blog 10]] - Pushbutton menu
*[[Blog 11]] - Turning off and on a lamp with crontab on special times
*[[Blog 12]] - Alarm Menu
*[[Blog 13]] - Scroll Menu
*[[Blog 14]] - BigRelay checker ( Raspberry Pi / Arduino )
*[[Blog 15]] - Basic stepper motor ( Raspberry Pi / Arduino )
dca66383893e25a5c476ed1c70b224869d4cec03
FT201X
0
1716
3478
3404
2015-11-06T15:47:41Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT201X.jpg|thumb|300px]]
This is the documentation page for the FT201X breakout board.
The FT201X breakout board can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft201x-breakout-board BitWizard shop].
== Overview ==
The FT201X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT201X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT201X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT201X.html FTDI product page]
== Pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>SCL</td><td>SDA</td></tr>
<tr><td>CBUS5</td><td>CBUS4</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
9ed11b308973a113ab8c26a5cfc900030a390283
FT220X
0
1717
3479
3405
2015-11-06T15:48:19Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT220X.jpg|thumb|300px]]
This is the documentation page for the FT220X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft220x-breakout-board BitWizard shop].
== Overview ==
The FT220X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT220X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT220X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT220X.html FTDI product page]
== Pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>MIOSI2</td><td>MIOSI3</td></tr>
<tr><td>MIOSI0</td><td>MIOSI1</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
Please note: On version 1.1 of the boards, the silkscreen markings for MIOSI1 and MIOSI3 are switched!
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
c4a8a40c9bb0cd88f9a0cfd0145e1dbc6eb111ae
FT221X
0
1718
3480
3406
2015-11-06T15:49:11Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT221X.jpg|thumb|300px]]
This is the documentation page for the FT221X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft221x-breakout-board BitWizard shop].
== Overview ==
The FT221X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT221X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT221X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT221X.html FTDI product page]
== Pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>MISO</td></tr>
<tr><td>CS#</td><td>CLK</td></tr>
<tr><td>MIOSI7</td><td>MIOSI6</td></tr>
<tr><td>MIOSI5</td><td>MIOSI4</td></tr>
<tr><td>MIOSI3</td><td>MIOSI2</td></tr>
<tr><td>MIOSI1</td><td>MIOSI0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
e28eba6e1a474934b2d6b985d12c5f8720a8f3d2
FT230X
0
1719
3481
3407
2015-11-06T15:49:36Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT230X.jpg|thumb|300px]]
This is the documentation page for the FT230X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft230x-breakout-board BitWizard shop].
== Overview ==
The FT230X breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT230X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT230X.html FTDI product page]
== Pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>CTS#</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The board is equipped with a power-LED, an Rx-LED and a Tx-LED
== Jumper settings ==
No jumpers this time :)
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
fa36af010275888cd77fc7b3b6bb5ac232d8e251
FT231X
0
1720
3482
3408
2015-11-06T15:50:02Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT231X.jpg|thumb|300px]]
This is the documentation page for the FT231X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft231x-breakout-board BitWizard shop].
== Overview ==
The FT231X breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT231X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT231X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT231X.html FTDI product page]
== Pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>CBUS3</td><td>CBUS2</td></tr>
<tr><td>CBUS1</td><td>CBUS0</td></tr>
<tr><td>RI#</td><td>DCD#</td></tr>
<tr><td>DSR#</td><td>DTR#</td></tr>
<tr><td>CTS#</td><td>RTS#</td></tr>
<tr><td>RXD</td><td>TXD</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
No jumpers this time :)
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
23cc9e3be334d7a487108134e53ae8037e7f2b31
FT240X
0
1721
3483
3409
2015-11-06T15:50:23Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT240X.jpg|thumb|300px]]
This is the documentation page for the FT240X breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft240x-breakout-board BitWizard shop].
== Overview ==
The FT240X breakout board has an USB connector, one 20-pin IO connector. The brains of the PCB, of course, is an FT240X chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT240X.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT240X.html FTDI product page]
== Pinout ==
The 20-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>VCCIO(jumpered)</td><td>DATA0</td></tr>
<tr><td>DATA1</td><td>DATA2</td></tr>
<tr><td>DATA3</td><td>DATA4</td></tr>
<tr><td>DATA5</td><td>DATA6</td></tr>
<tr><td>DATA7</td><td>RXF#</td></tr>
<tr><td>TXE#</td><td>RD#</td></tr>
<tr><td>WR#</td><td>SI/WU#</td></tr>
<tr><td>CBUS5</td><td>CBUS6</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The only jumper Is for selecting the I/O voltage. 1-2 = 1V8, 2-3 = 3V3.
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
144e33cc632d5caaa591e41115f091c6fdb788e1
FT245RL V1.5
0
1724
3484
3410
2015-11-06T15:50:47Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT245RL.jpg|thumb|300px]]
This is the documentation page for the FT245RL breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft245rl-breakout-board BitWizard shop].
== Overview ==
The FT245RL breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT245R.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT245R.htm FTDI product page]
== Pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>TXE#</td><td>RXF#</td></tr>
<tr><td>RD#</td><td>WR</td></tr>
<tr><td>D7</td><td>D5</td></tr>
<tr><td>D5</td><td>D4</td></tr>
<tr><td>D3</td><td>D2</td></tr>
<tr><td>D1</td><td>D0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The only jumper is for selecting the I/O voltage. Place the jumper on the left side for 3V3, or on the right side for 5V.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
696f065ac3db5ba82675ccec34b5cfc674d2889e
3485
3484
2015-11-06T15:50:58Z
Cartridge1987
2553
/* future hardware enhancements */
wikitext
text/x-wiki
[[File:FT245RL.jpg|thumb|300px]]
This is the documentation page for the FT245RL breakout board. That can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft245rl-breakout-board BitWizard shop].
== Overview ==
The FT245RL breakout board has an USB connector, one 16-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT245R.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT245R.htm FTDI product page]
== Pinout ==
The 16-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>TXE#</td><td>RXF#</td></tr>
<tr><td>RD#</td><td>WR</td></tr>
<tr><td>D7</td><td>D5</td></tr>
<tr><td>D5</td><td>D4</td></tr>
<tr><td>D3</td><td>D2</td></tr>
<tr><td>D1</td><td>D0</td></tr>
<tr><td>GND</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The only jumper is for selecting the I/O voltage. Place the jumper on the left side for 3V3, or on the right side for 5V.
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
e0a50050cd90919dad2b5eb8514a5107a7542c02
FT311D
0
1722
3486
3411
2015-11-06T15:51:23Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT311D.jpg|thumb|300px]]
This is the documentation page for the FT311D breakout board. The can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft331d-breakout-board BitWizard shop].
== Overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
== Using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== Pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== Future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
88f8302bacf56b5495599f7e2ef87428435aefd5
FT312D
0
1723
3487
3413
2015-11-06T15:51:57Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:FT312D.jpg|thumb|300px]]
This is the documentation page for the FT312D breakout board. (FT 312 D to help people like me find it with the search function). <br> The FT312D breakout board can you buy in the [http://www.bitwizard.nl/shop/breakout-boards/ft312d-breakout-board BitWizard shop].
== Overview ==
The FT312D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT312D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT312D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT312D.html FTDI product page]
== Using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== Pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>NC</td><td>NC</td></tr>
<tr><td>TX_ACTIVE</td><td>CTS#</td></tr>
<tr><td>RTS#</td><td>RXD</td></tr>
<tr><td>TXD</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The left two jumpers should be placed, the third (right) jumper should NOT be placed.
== Future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
1f45f50527447b1a7895a94e6b49207717b02a86
FT245RL breakout board
0
10
3488
141
2015-11-06T15:52:22Z
Cartridge1987
2553
wikitext
text/x-wiki
= FT245RL breakout board =
This is the documentation page for the FT245RL breakout board.
== Overview ==
The FT245RL breakout board has an USB connector and a 20-pin IO connector. The brains of the PCB, of course, is an FT245RL chip.
== External resources ==
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>D1</td></tr>
<tr><td>4</td><td>D5</td></tr>
<tr><td>5</td><td>D2</td></tr>
<tr><td>6</td><td>D7</td></tr>
<tr><td>7</td><td>D0</td></tr>
<tr><td>8</td><td>D4</td></tr>
<tr><td>9</td><td>D3</td></tr>
<tr><td>10</td><td>D6</td></tr>
<tr><td>11</td><td>WR</td></tr>
<tr><td>12</td><td>RD#</td></tr>
<tr><td>13</td><td>RXF</td></tr>
<tr><td>14</td><td>TXE#</td></tr>
<tr><td>15</td><td>NC</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>NC</td></tr>
<tr><td>18</td><td>NC</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 (near the bottom) is connected to VCC
== Jumper settings ==
IO and supply voltage to 20-pin connector<br>
1-2: 3V3<br>
2-3: 5V<br>
== Future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
a5a00c3fced002b8db528058101173b00b5c24e4
FT2232H breakout board
0
12
3489
1232
2015-11-06T15:52:54Z
Cartridge1987
2553
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 20-pin HDR-standard IO connectors (one for BUS0 and one for BUS1), and one 40-pin terasic compatible connector. The brains of the PCB, of course, is an FT2232H chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>ACBUS5</td><td>1</td><td>2</td><td>NC</td></tr>
<tr><td>NC</td><td>3</td><td>4</td><td>NC</td></tr>
<tr><td>ADBUS0</td><td>5</td><td>6</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>7</td><td>8</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>9</td><td>10</td><td>ADBUS5</td></tr>
<tr><td>5V</td><td>11</td><td>12</td><td>GND</td></tr>
<tr><td>ADBUS6</td><td>13</td><td>14</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>15</td><td>16</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>17</td><td>18</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>19</td><td>20</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>21</td><td>22</td><td>ACBUS7</td></tr>
<tr><td>BDBUS0</td><td>23</td><td>24</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>25</td><td>26</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>27</td><td>28</td><td>BDBUS5</td></tr>
<tr><td>3V3</td><td>29</td><td>30</td><td>GND</td></tr>
<tr><td>BDBUS6</td><td>31</td><td>32</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>33</td><td>34</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>35</td><td>36</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>37</td><td>38</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>39</td><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>ADBUS0</td><td>3</td><td>4</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>5</td><td>6</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>7</td><td>8</td><td>ADBUS5</td></tr>
<tr><td>ADBUS6</td><td>9</td><td>10</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>11</td><td>12</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>13</td><td>14</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>15</td><td>16</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>17</td><td>18</td><td>ACBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see J2 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== Future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
a4466fdc617c8a51b986c75db34e0c33aa6e9e54
FTDI serial
0
19
3490
3035
2015-11-06T15:53:22Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial board.
== Overview ==
The FTDI-serial board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
For references to left-right, and top-bottom in this page, please hold the board with the USB connector on the left and the serial connector on the right.
== External resources ==
== Pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td><td>do not drive at 5V level if jumper is set to 3.3v.<br>
probably works if driven at 3.3V with jumper at 5V.</td></tr>
<tr><td>3</td><td>Tx (T)</td><td>works at 5V or 3.3V level depening on jumper</td></tr>
<tr><td>4</td><td>V+</td><td>5V or 3.3V depending on jumper</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to CBUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (jumper on the side nearest the chip and USB connector)<br>
2-3: 5V (jumper near the serial connector)<br>
<br>
This switches the "VCCIO" pin on the FT232RL chip, as well as the "V+" pin on the serial connector.
At the 3.3V setting you're allowed to draw up to 50mA from this pin.
At the 5V setting, you can use whatever the USB bus allows. Officially that would probably be 100mA, as the FTDI chip, by default, doesn't ask for more. However, in practise you can very often get away with drawing as much as 500mA (even without asking). You can program the chip to ask for more by programming the eeprom of the chip using an FTDI programming utility.
== Future hardware enhancements ==
Allow "hacker" access to more IOs on the FTDI chip with "test pads" on the bottom of the PCB.
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
7b5a26b89c317d687f4632ec60b8b0bb7fc4a161
FTDI serial 2
0
625
3491
3440
2015-11-06T15:53:48Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the documentation page for the FTDI-serial 2 board. That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-uart-ftdi BitWizard shop].
== Overview ==
The FTDI-serial 2 board has an USB connector and a 4-pin serial/UART connector. The brains of the PCB is an FT232RL chip.
== External resources ==
== Pinout ==
The 4 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>Ground (G)</td></tr>
<tr><td>2</td><td>Rx (R)</td></tr>
<tr><td>3</td><td>Tx (T)</td></tr>
<tr><td>4</td><td>VCC (T)</td></tr>
</table>
* led1 is connected to CBUS0 (Tx activity)
* led2 is connected to BCUS1 (Rx activity)
* led3 is connected to VCC
== Jumper settings ==
IO voltage<br>
1-2: 3V3 (place jumper near FTDI)<br>
2-3: 5V (place jumper near UART header)<br>
== Future hardware enhancements ==
== Changelog ==
=== 2.0 ===
* Size reduced considerably
* Added an VCC pin to the Rx/Tx connector
=== 1.0 ===
* Initial public release
b9fa8aaae979967c81c037d430f7468418946983
Blog 16
0
1822
3492
2015-11-06T16:13:11Z
Cartridge1987
2553
Created page with "== Working with 2 7FETs Stepper motors == == Talking to the second 7FETs ( stepper motor ) == How to find the second 7FETs( on spi1 ). The other 7FETS also of course has ..."
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address.
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code I add a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast otherwise one of them will keep spinning around. I also make it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#bw_tool -s 50000 -a 88 -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
32d94b2171c523fd1d76ae1f7f353ae1600cb1d8
3495
3492
2015-11-06T16:37:44Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address.
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code I add a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast otherwise one of them will keep spinning around. I also make it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#bw_tool -s 50000 -a 88 -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
56c6b86bed25c5d31bdd313087c02dbc9c3e1124
3496
3495
2015-11-09T12:03:03Z
Cartridge1987
2553
/* Talking to the second 7FETs ( stepper motor ) */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code I add a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast otherwise one of them will keep spinning around. I also make it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#bw_tool -s 50000 -a 88 -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
61294c552a89952a575deb42be6b4841028cfaca
3497
3496
2015-11-09T12:19:49Z
Cartridge1987
2553
/* Talking to the second 7FETs ( stepper motor ) */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
'''Raspberry Pi version:'''
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
'''Arduino version:'''
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code I add a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast otherwise one of them will keep spinning around. I also make it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#bw_tool -s 50000 -a 88 -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
418aa99e80e9f820499b8fb313d08b10173ba357
3498
3497
2015-11-09T12:54:01Z
Cartridge1987
2553
/* 2 7FETs stepper motors controlled by pushbuttons */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
'''Raspberry Pi version:'''
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
'''Arduino version:'''
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code I add a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast otherwise one of them will keep spinning around. I also make it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate 180 degrees )
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
e8fac66a7f8648b9e0ccd70ef7548386a692e2f6
3499
3498
2015-11-09T13:24:51Z
Cartridge1987
2553
/* 2 7FETs rotating plateaus */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
'''Raspberry Pi version:'''
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
'''Arduino version:'''
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate 180 degrees )
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
83c93d270648b4221427cbc77a63e9f6e764dd11
3500
3499
2015-11-09T13:27:04Z
Cartridge1987
2553
/* 2 7FETs stepper motors controlled by pushbuttons */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
'''Raspberry Pi version:'''
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
'''Arduino version:'''
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
e84f8252a8fa8eeb250ea72e1bd3e660a0184fa1
3501
3500
2015-11-09T13:27:18Z
Cartridge1987
2553
/* Talking to the second 7FETs ( stepper motor ) */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
254a90914b12a26e74437d9e7aea309785f03ae7
3502
3501
2015-11-09T13:29:16Z
Cartridge1987
2553
/* Working with 2 7FETs Stepper motors */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed in:
*Bash
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
1e28166a5b846ee2ed00df1205f383cdd57d0ab7
3503
3502
2015-11-09T13:35:07Z
Cartridge1987
2553
/* Working with 2 7FETs Stepper motors */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed in:
*Bash
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
21bc7677efe19ce95a54f9eb89dd22550e6b428a
3508
3503
2015-11-10T13:38:58Z
Cartridge1987
2553
/* 2 7FETs stepper motors controlled by pushbuttons */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed in:
*Bash
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with a 7FETs Stepper motors [[Blog 15]]
*Example script for working with arduino from BitWizard:[http://www.bitwizard.nl/software/ ardemo_lcd.pde]
98f42dc76dc49b1d9522330900e0d85715f9d75a
3509
3508
2015-11-10T13:39:20Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed in:
*Bash
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with a 7FETs Stepper motors [[Blog 15]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
72cf44268d1effba8cc16586f338694a9454a0f7
File:27FETsStepperMotors.jpg
6
1823
3493
2015-11-06T16:33:58Z
Cartridge1987
2553
2 7FETs connected with the raspberry pi through spi cables. On the 2 7FETs are stepper motors connected.
wikitext
text/x-wiki
2 7FETs connected with the raspberry pi through spi cables. On the 2 7FETs are stepper motors connected.
76602f3bdb3bdf7074e32e7a7fa66483d3dd1367
File:27FETsStepperMotorsV.jpg
6
1824
3494
2015-11-06T16:36:06Z
Cartridge1987
2553
Vertical picture of the 2 Stepper motors being connected with 2 7Fets to a Raspberry Pi.
wikitext
text/x-wiki
Vertical picture of the 2 Stepper motors being connected with 2 7Fets to a Raspberry Pi.
44686dce8b484c63d115609e8131d33db858ef2e
Blog 15
0
1817
3504
3449
2015-11-10T13:22:34Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
[[Blog 14]]
b26d7a88e105c2f3d16a3c574dd99bf990e60d88
3505
3504
2015-11-10T13:26:39Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*[[Blog 14]]
*[http://www.bitwizard.nl/software/ ardemo_lcd.pde]
08531c054bc37bdd19f6c1331f8cc22fc10906ca
3506
3505
2015-11-10T13:34:17Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board[[Blog 14]]
*Working with multiple 7FETs Stepper motors[[Blog 16]]
*Example script for working with arduino from BitWizard:[http://www.bitwizard.nl/software/ ardemo_lcd.pde]
131876231b6796bce690324f961dc9d3b824aa40
3507
3506
2015-11-10T13:34:32Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*Example script for working with arduino from BitWizard:[http://www.bitwizard.nl/software/ ardemo_lcd.pde]
bc5b3152775c28471fa9742c612ed534280fdfb4
3510
3507
2015-11-10T13:39:36Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
d4bcdcca9da7275ed585c37542ce62f20f9f8935
Blog 14
0
1815
3511
3374
2015-11-10T13:44:07Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/bigrelay BigRelay board] | ([[Relay]])
Hardware I used for the Arduino:
*[http://www.bitwizard.nl/shop/lcd-interface SPI_LCD board] | ([[LCD]])
*[http://www.bitwizard.nl/shop/bigrelay BigRelay board] | ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-state.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the given relay number and will perform the on/off cycle on that relay.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
Here it will iterate the variable i from 20 to 25 and will run activate the doreplay function on each iteration.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can get a larger value than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be zero (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u ", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and %u for showing in unsigned decimals. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
94871d7ba6f484111bcc943b41dd8a9f81c8ea7b
Usbbigmultio
0
5
3512
3398
2015-11-10T14:09:55Z
Sjoerd
2544
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USB bigmultio PCB.
The USB bigMultio PCB can be bought in the [http://www.bitwizard.nl/shop/avr-boards/raspduino BitWizard shop].
== Overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf ATmega16/32U4 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
== Pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Future hardware enhancements ==
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 1.1 ===
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
=== 1.0 ===
* Initial release
da649dba3d35bb1ad96a7b2d412182161904d56c
Usbio kitt
0
3
3513
822
2015-11-11T10:45:11Z
Cartridge1987
2553
/* usbio Kitt */
wikitext
text/x-wiki
== Usbio Kitt ==
The usbio kitt is a sample program. It runs on the [[usbio]].
It is very basic in that it only uses generic AVR IO ports and not the USB functions of the device. The board will not enumerate on the USB bus when this demo is loaded.
The source code can be downloaded from http://www.bitwizard.nl/software/kitt.tgz
48d2380f4303f47ee02c951433609012503698bd
Usbio ACM sample program
0
4
3514
2929
2015-11-11T10:45:35Z
Cartridge1987
2553
wikitext
text/x-wiki
== USBIO sample ACM program ==
The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board.
Under Linux if you connect your usbio board when it is loaded with this program, you will get a /dev/ttyACM0 device.
Under windows you will have to follow the directions of the LUFA documentation which include downloading and using the INF file located: https://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/LUFA%20VirtualSerial.inf?r=1607
The LUFA explanation is here: http://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt?spec=svn1470&r=1470
Once you have the driver sorted, you can use any terminal program you like to connect with the board. I use "kermit" to communicate with serial devices like this. There are several other programs available, but I'm used to kermit. Under windows there is a program called hyperterm.
Once you connect to the device, you will be prompted with a welcome string and a prompt. You can use several commands:
=== s ===
if you type s<outputnumber> the output with that number will go high. Outputnumber is in hex. For usbio the output numbers go from 0 to f. For example s5 will turn on output 5.
=== c ===
if you type c<outputnumber> the output with that number will be cleared. For example: ce will clear output 14 (which is e in hex).
=== a ===
If you type a<output> <value> the output will be put in software pwm mode. Currently values 0...80 are supported (128 levels).
=== p ===
If you type p <output> <length> the output with that number will be pulsed for <length> ms. The length is of course in hex.
=== z ===
If you type "z" the board will reset into firmware-upload-mode.
== Download ==
You can download the source from: http://www.bitwizard.nl/software/usbio.tgz
You then need to download LUFA, and place it in the directory usbio/../LUFA (i.e. next to the usbio directory).
== Future enhancements ==
In the future we'll enhance the program to allow setting the mode of pins to inputs. And the program should be able to monitor the inputs value, and report the state changes as they happen. Also on-demand questioning of the inputs should become possible.
20d515261a9d5e83936c0df734c69c1a57f1a31c
Raspberry Pi LCD program
0
760
3515
1423
2015-11-11T10:45:58Z
Cartridge1987
2553
wikitext
text/x-wiki
== Download ==
download the program source from http://www.bitwizard.nl/software/bw_lcd.c
You will need a kernel with spidev enabled and the raspberry pi SPI driver included. See [[Raspberry pi spi kernel]]
This program works well with the rpi_serial board http://www.bitwizard.nl/catalog/product_info.php?cPath=25&products_id=69 and the spi_lcd board: http://www.bitwizard.nl/catalog/product_info.php?products_id=89 .
== Command line arguments ==
SPI options:
-D <device> SPI device to use. default: /dev/spidev0.0
-s <speed> speed to use on the SPI bus default 0.5MHz.
-d <delay> delay between bytes. default: 15 us.
LCD options:
-a <addr> address of display, defaults to 0x82
-p <c>,<l> Jump to line <l> and character <c>
-t <text> print text
-T <c>,<l> <text> Print tekst starting at line <l> character <c>.
-b < b > Adjust backlight level
-c <c> Adjust contrast
-C clearscreen
-f <file> display text from file (not implemented yet).
general bw SPI options:
-r <reg>
-v <val> set register to value. Requires -r.
== Example commands ==
Print current date on line 0:
bw_lcd -p 0,0 -t `date +%m/%d/%Y`
Print the text "Hello World" on line 1, character 2:
bw_lcd -T 2,1 "Hello World"
Print the contents of "textfile":
bw_lcd -f textfile
Write two different strings to two daisy-chained displays:
bw_lcd -a 82 -T 0,0 display0
bw_lcd -a 84 -T 0,0 display1
My Pi runs the following script every minute:
#! /bin/sh
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 'My wlan0 IP is'
./bw_lcd -a 80 -T 0,1 `/sbin/ifconfig wlan0 | sed '/inet\ /!d;s/.*r://g;s/\ .*//g'`
./bw_lcd -a 82 -T 0,0 'My eth0 IP is'
./bw_lcd -a 82 -T 0,1 `/sbin/ifconfig eth0 | sed '/inet\ /!d;s/.*r://g;s/\ .*//g'`
This prints the IP addresses of both network interfaces on my two displays.
c26b6995996c2ce4e4567ec868045ea3a4378e66
Main Page
0
1
3516
3464
2015-11-11T10:46:29Z
Cartridge1987
2553
/* How-to's */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
18517c8b84ae52a5d2a4244113175ee721a4123f
3517
3516
2015-11-11T10:47:06Z
Cartridge1987
2553
/* Sample projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
5fe26412c8e8c90de5769c9afbf5e0b10ed08e87
3518
3517
2015-11-11T10:47:19Z
Cartridge1987
2553
/* Raspberry Pi projects */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
e8bc2435f2bc7cc591d1fbaf5d75bb675055bd78
3519
3518
2015-11-11T10:47:50Z
Cartridge1987
2553
/* Miscellaneous */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
a971ce86ae2378245bb4c57fec92d630d84ebf0f
3520
3519
2015-11-11T10:48:27Z
Cartridge1987
2553
/* Developement boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[pushbutton]]
* [[rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
4dc3efa0c9a38878ad7746a949c0b96834fc1224
3521
3520
2015-11-11T10:49:35Z
Cartridge1987
2553
/* Board specific pages */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
afeb735cd8a5f82e58f759df0bbdce355d1be83f
Raspberry pi expansion system page
0
86
3522
2726
2015-11-11T10:51:17Z
Cartridge1987
2553
wikitext
text/x-wiki
= Intro =
If you want to hook up your raspberry pi to interface with the rest of the world, this is the right place to look!
For some things like standard RS232 serial ports or webcams, you can get cheap USB devices. But to drive a small 16x2 character LCD, or to switch mains-power rpi_serial is for you.
= Rpi_serial =
The rpi_serial board is the simplest breakout board for the [http://raspberrypi.org/ Raspberry pi].
It breaks out the following serial buses:
* SPI0
* SPI1
* I2C
* UART
As the rasberrypi runs at 3.3V IO signal levels, the board allows 5V peripherals to be connected. The board can be configured for 5V operation or for 3.3V operation but not both.
= Rpi_ui: the raspbery pi user interface =
This board is available in a version with 20x4 and a version with 16x2 display. As the rpi_serial it breaks out all the serial busses of the raspberry pi. It also has a display and 6 buttons integrated on the board. These are accessible through SPI0 or the I2C bus.
= Expansion boards =
The following expansion boards have been designed:
* [[SPI_LCD]]
* [[7FETs|SPI_7FETs]]
* [[3FETs|SPI_3FETs]]
* [[Servo|SPI_Servo]]
* [[LM35|SPI_LM35]]
* [[DIO|SPI_DIO]]
* [[Relay|SPI_relay]]
* [[I2C_LCD]]
* [[7FETs|I2C_7FETs]]
* [[3FETs|I2C_3FETs]]
* [[Servo|I2C_Servo]]
* [[LM35|I2C_LM35]]
* [[DIO|I2C_DIO]]
* [[Relay|I2C_relay]]
Planned are the optocoupler expansion board and the button expansion board. If you have suggestions for more, please let us know.
These expansion boards have two SPI connectors. The first SPI connector is for data transfer during normal operation. The other can be used to daisy-chain the SPI bus to other SPI expansion boards. Or it can be configured to be used as the programming port for the onboard AVR chip.
It should be possible to use one of the raspberry pi SPI buses for data-transfer, while you use the other one to program the AVR chip on the expansion board.
2e7730e5ee2388104cb6044e7aa7e9b11457684f
LCD
0
716
3523
3418
2015-11-11T10:52:23Z
Cartridge1987
2553
/* troubleshooting */
wikitext
text/x-wiki
[[File:DSC04653.JPG|thumb|300px|alt=The SPI_LCD board|The SPI_LCD board]]
This is the documentation page for the SPI_LCD and I2C_LCD boards. That you can buy in the [http://www.bitwizard.nl/shop/displays BitWizard shop].
== Overview ==
== Assembly instructions ==
The board comes fully assembled, as depicted in the picture on the top right of this page..
We assemble the ones with LCD with just a pin header between the board and the LCD, so you could do the same. Make sure you put the LCD in correctly. I'm not sure everything survives the wrong polarity.
[[File:LCD_config_3.JPG|none|thumb|300px|alt=Recommended configuration|Recommended configuration]]
[[File:LCD_config_4.JPG|none|thumb|300px|alt=Also possible|Also possible]]
[[File:LCD_config_5.JPG|none|thumb|300px|alt=Not recommended configuration|Not recommended configuration]]
=== Possible Configurations ===
For the SPI version the second SPI port can be used as an ICSP connector. You need to toggle the solder jumper for this. The I2C or SPI bus cannot be left connected during programming.
The contrast setting depends strongly on the voltage of the power line. We test the boards with our powersupply and deliver them with a contrast setting that works for us. However if your powersupply has a higher or lower voltage, the proper contrast setting might be different.
== External resources ==
=== Datasheets ===
The fet:
http://www.irf.com/product-info/datasheets/data/irlml2244pbf.pdf
The CPU:
http://www.atmel.com/dyn/resources/prod_documents/doc8006.pdf
== Additional software ==
For the I2c version there is a demo project for arduino at http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde
For the SPI version there is a demo project for arduino at http://www.bitwizard.nl/software/ardemo_lcd.pde
For use with the raspberry pi use the [https://github.com/rewolff/bw_rpi_tools bw_rpi_tools package from github](and then only the bw_tool program).
=== Related projects ===
* [[Beginners_guide_to_SPI_on_Raspberry_Pi]]
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]]. <br>
For the I2C connector see: [[I2C_connector_pinout]].
To connect the I2C board to a raspberry pi without a converter board ("rpi_serial"), you can use 4 separate wires. This is shown here: [[File:DSC04800.JPG|none|thumb|300px|alt=I2C without RPI_serial|I2C without RPI_serial]]
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector furthest from the CPU. <br>
In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. <br>
In the other configuration, the second SPI connector is the ICSP connector. <br>
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
== Programming ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[lcd protocol 1.6]] (both I2C and SPI).
For reference: here are older versions of the document: [[spi_lcd 1.3_protocol]] [[spi_lcd_1.2_protocol]] [[i2c_lcd_protocol]]
You should also read the [[General_SPI_protocol]] notes.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at BitWizard software download directory .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for LCD boards as well.
== Troubleshooting ==
If your display stays blank while turning on your system, this might be an indication of that the power supply is rising too slowly. In that case, the processor on your spi_lcd or i2c_lcd board is booting before the controller on the LCD sub-assembly has enough power to work. In that case, you need to send a dummy byte to the 0x14 port. This will reinitialise the LCD.
== The software ==
If you are going to connect your I2C_LCD or SPI_LCD to a raspbery pi, read: [[getting started with rpi_serial and BitWizard expansion boards]]
== Future hardware enhancements ==
hardware potentiometer for the contrast. (option).
== Future software enhancements ==
* Lock the address. (require a sequence of commands to change the address).
== Changelog ==
=== 1.2 ===
* Initial public release
9aaa25b363fca81d40d924dfed0b19517b960866
3FETs
0
483
3524
3420
2015-11-11T10:53:23Z
Cartridge1987
2553
/* powering the 3FETs board */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/3fets BitWizard shop].
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering the 3FETs board ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
37899bf576fb76bb6b1cc8582a3c66d892c7c473
3525
3524
2015-11-11T10:53:35Z
Cartridge1987
2553
/* jumper settings */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/3fets BitWizard shop].
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering the 3FETs board ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
bd60e1c07c0bf203529e93162886bb963617770d
3526
3525
2015-11-11T10:53:50Z
Cartridge1987
2553
/* block diagram */
wikitext
text/x-wiki
[[File:SPI_3FETs.jpg|thumb|300px|alt=The SPI_3FETs board|The SPI_3FETs board]]
This is the documentation page for the SPI_3FETs and I2C_3FETs boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/3fets BitWizard shop].
== Overview ==
The board has 3 FETs that allow you to pull a pin of a load low. You would normally tie the other end of your load directly to the power supply.
About 5A per output is possible. Maximum voltage is 24V.
You will have to provide your own protection circuits if you are going to drive inductive loads (like a motor).
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The 3FETs board is capable of sinking about 5A per output. We have tested 5 A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 5A
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
[http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== Block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering the 3FETs board ==
Although some BitWizard boards will work with 3.3V as the power supply, the 7fets board needs to be supplied with 5V as this voltage is used to drive the FETs.
== Protocol ==
To make the 3fets PCB do things, you need to send things over the SPI or I2C bus to the PCB.
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]].
In case of SPI, please read the [[General_SPI_protocol]] notes.
The specific commands for the 3fets PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the 3fets board will drive the output pin LOW when the pin is driven active.
Some 3fets boards were shipped with software that would default the outputs to inputs. On those you need to set all pins to outputs by sending 0xff to register 0x30 in your initialization sequence.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and 3fets boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
0096bc0b870da2a3e15c2776e7fc4595401a3030
Temperature Interface
0
51
3527
3436
2015-11-11T10:54:13Z
Cartridge1987
2553
/* accuracy */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/temp-interface BitWizard shop].
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== Accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== examples ==
The folowing script
#!/bin/sh
# Sample script to read and calculate a temperature.
#
# for I2C:
TEMPBRD="bw_tool -I -D /dev/i2c-1 -a 8c"
# for SPI:
#TEMPBRD="bw_tool -a 8c"
#
if [ x"$1" = x"--init" ] ; then
# First initialize the temperature sensor.
# Channel 0 is first sensor, ... channel 3 is last sensor, sample four channels,
# add 64 (0x40) samples, and then... don't shift
$TEMPBRD -W 70:81:b 71:80:b 72:82:b 73:83:b 80:4:b 81:40:b 82:0:b
# wait for the settings to apply and enough sampes to be taken.
sleep 1
fi
adcconversion=`$TEMPBRD -1 -R 68:s`
# This value is scaled to 65535 is 1.1V.
# So:
# (1) voltage = adcconversion * 1.1 / 65535
# For the MCP9700 temperature sensor:
# (2) voltage = 0.5V + temp * 0.010V/C
# Some reworking results in:
# (3) temp = (voltage - 0.5)/0.01
# Now we can substitute the voltage from (1) and get:
# (4) temp = 100 * (adcconversion * 1.1 / 65535 - 0.5)
# and reworking this we get:
# (5) temp = .001678 * adcconversion - 50
temp=`echo $adcconversion \* .001678 - 50 | bc -l`
echo "temperature is: $temp"
will initialize all four channels if you pass it --init and then read out just the first. On the adcconversion= ... line you need to change to 69 for the second sensor, 6a for the third and 6b for the last.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
54dbb96a66b08699af9f090301cb478f8af0ea0d
3528
3527
2015-11-11T10:54:23Z
Cartridge1987
2553
/* examples */
wikitext
text/x-wiki
[[File:Tempic.jpg|thumb|300px|alt=Temperature Interface|Temperature Interface]]
This is the documentation page for the Temperature Interface. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/temp-interface BitWizard shop].
== Overview ==
This board enables you to measure up to 4 analog signals, specifically configured for measuring temperature with an MCP9700 sensor (or LM35 if you only require above-freezing temperatures).
== Assembly instructions ==
None: the board comes fully assembled. The orientation of your sensor is indicated on the board, if you use the recommended MCP9700. We suggest you first test with the MCP9700 directly inserted into the socket in the board, before you make an extension cord to put it where you want to measure the temperature.
Officially electronics should easily be able to handle temperatures of about 80 °C, so it should be possible to put the whole module where you want to measure. I'd try try to avoid that situation.
=== Possible Configurations ===
with MCP9700 or LM35. If you know of other sensors that provide a similar signal, let us know.
== External resources ==
=== Datasheets ===
* MCP9700: http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf
* LM35: http://www.ti.com/lit/ds/symlink/lm35.pdf
== Additional software ==
=== Related projects ===
This is a simplified version of the "DIO", but with a more convenient pinout for its purpose. We've taken out the features that cannot be used anyway on this board, like stepper motor control.
== Pinout ==
Each of the four temperature connectors has:
* 1 VCC
* 2 signal
* 3 GND
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
=== LEDs ===
There is one power-led.
== Jumper settings ==
There is one solder jumper that would allow you to configure the second SPI port as a programming connector for software development.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]] The STEPPER, BUTTONS and PWM functions are not implemented on "temp".
See [[Analog inputs]] for the configuration of the ADC channel you need for each of the connectors.
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO and TEMP boards as well.<br>
== Accuracy ==
The sensors claim a +/- 1 or +/- 2 degree accuracy. But the system adds a few more uncertainties. For example, the "internal 1.1V reference" is officially +/- 10%. In practise we've measured it way closer to 1.1 than the range would suggest, but it is a possible source of errors. Similarly, the analog amplifier has an offset voltage that contributes to the overall error.
In practise we often see an error on the order of 5 degrees C too high compared to the ideal temperature reading. We suggest you calibrate at least the offset by doing a reference measurement with a thermometer that you trust. Best would be to electrically insulate the sensor and put it in melting water (0C), and then in boiling water (100C). That way you can calibrate both the offset and gain.
== Examples ==
The folowing script
#!/bin/sh
# Sample script to read and calculate a temperature.
#
# for I2C:
TEMPBRD="bw_tool -I -D /dev/i2c-1 -a 8c"
# for SPI:
#TEMPBRD="bw_tool -a 8c"
#
if [ x"$1" = x"--init" ] ; then
# First initialize the temperature sensor.
# Channel 0 is first sensor, ... channel 3 is last sensor, sample four channels,
# add 64 (0x40) samples, and then... don't shift
$TEMPBRD -W 70:81:b 71:80:b 72:82:b 73:83:b 80:4:b 81:40:b 82:0:b
# wait for the settings to apply and enough sampes to be taken.
sleep 1
fi
adcconversion=`$TEMPBRD -1 -R 68:s`
# This value is scaled to 65535 is 1.1V.
# So:
# (1) voltage = adcconversion * 1.1 / 65535
# For the MCP9700 temperature sensor:
# (2) voltage = 0.5V + temp * 0.010V/C
# Some reworking results in:
# (3) temp = (voltage - 0.5)/0.01
# Now we can substitute the voltage from (1) and get:
# (4) temp = 100 * (adcconversion * 1.1 / 65535 - 0.5)
# and reworking this we get:
# (5) temp = .001678 * adcconversion - 50
temp=`echo $adcconversion \* .001678 - 50 | bc -l`
echo "temperature is: $temp"
will initialize all four channels if you pass it --init and then read out just the first. On the adcconversion= ... line you need to change to 69 for the second sensor, 6a for the third and 6b for the last.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
82fc0554422eb6603c7bfe2515e5f89956bba7f5
Motor
0
658
3529
3431
2015-11-11T10:54:54Z
Cartridge1987
2553
/* jumper settings */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board. That can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/motor BitWizard shop].
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version. A sticker on the bottom of the board defines which of the two it is.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 10V to 14V power supply. Please refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2. The motor voltage is used to drive the FETs
|-
| >14V || Jumper on pins 2 and 3. The onboard regulator generates 12V from the motor voltage.
|}
If a FET is built to use 12V gate voltages, it will only conduct partially when you drive it with lower voltages. The FET would run hot or self-destruct very quickly if that happens. So to prevent this from happening the FET-driver will not drive the FET at all if the gate-drive-voltage is not above 8V. That is why even if your motor runs on 5V you cannot use 5V for the gate-drive-voltage.
=== LEDs ===
The only LED is a power LED.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
ac4e673d989882de867d1b2ba76911b8be8224f3
Raspberry Juice
0
1699
3530
3120
2015-11-11T10:56:02Z
Cartridge1987
2553
/* usage */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Protocol definitions =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
= Usage =
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== User input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
When the 'pi is off, the 'juice will go into a power-saving mode. It will only test the button a few times per second. In this situation it is possible to press-and-release the button between two checks by the 'juice. To prevent this, you need a slightly longer press.
=== Software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== Halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
Or you could write a 0 to register 0x33. That would immediately turn off the power.
=== Setting powerup-defaults ===
The module has to know what to do when IT first receives power. So you can write to registers 0x38 through 0x3b to set the default values that get loaded into the variables at 0x30-0x33 at powerup. The values you set are stored in eeprom and will be used on the next boot.
=== Sensitivity to inputs ===
The board can listen to the button on the board, as well as the external input. You could, for example, tell the board not to listen to the button while the 'pi is running. Then just before shutting down you enable the button again, and tell the 'juice to cut the power.
There is also an external input. You could connect an external switch, or drive it from some other source. Either the UP or the DOWN transition is considered an activation. You can set which one with the polarity variable.
= examples =
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
Explanation of the command:
* -I and -D /dev/i2c-1 specify that the module is the I2C version. If you use SPI0, you can leave these off. When you use SPI1, you would specify -D /dev/spidev0.1
* -a a4 specifies the address of the module on the bus. 0xa4 is the 'juice address. You could change this, but this is usually not necessary (it does not make sense to have more than one of these modules).
* -W specifies that you want to write to an address.
* 21:2710:i is the register, 21, the value 0x2710 = 10000, and the datatype i=32-bit-integer.
* 20:3e8:i is the register, 20, the value 0x3e8 = 1000, and the datatype i=32-bit-integer.
897be6255f294bc75542a3db7772ba4ca8e7a847
3531
3530
2015-11-11T10:56:15Z
Cartridge1987
2553
/* examples */
wikitext
text/x-wiki
[[File:RaspberryJuice.jpg|thumb|300px|The Raspberry Juice board]]
= Overview =
The Raspberry Juice serves as a power switch for the Raspberry Pi. This expansion board can turn the power on or off at a scheduled time. [http://www.bitwizard.nl/shop/raspberry-pi/raspberry-juice shop link]
= Specifications =
The Juice always uses about 2mA/10mW. The board is rated for a maximum current of 1A.
= Protocol definitions =
The Raspberry Juice can be found using I2C or SPI at address 0xA4, and has the following read ports:
All times are in ms, and are 32 bits in size.
{| border=1
! Port !! Returned value (in milliseconds)
|-
| 0x20 || Time until power off
|-
| 0x21 || Time until power on
<!--
|-
| 0x28 || Absolute scheduled time of power off
|-
| 0x29 || Absolute scheduled time of power on
-->
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
Additionally, the following can be written to the Juice:
{| border=1
! Port !! Effect
|-
| 0x20 || Set the time in milliseconds until power off
|-
| 0x21 || Set the time in milliseconds until power on
|-
| 0x30 || button active || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x31 || external input active || 0: inactive (default), 1: active, others: undefined.
|-
| 0x32 || external input polarity || 0: active low (default), 1: active high, others: undefined.
|-
| 0x33 || power set on/off state || 0: off, 1: on, others: undefined.
|-
| 0x38 || button active powerupstate || 0: don't react to button press. 1: react to button press (default), others: undefined.
|-
| 0x39 || external input active powerupstate || 0: inactive (default), 1: active, others: undefined.
|-
| 0x3a || external input polarity powerupstate || 0: active low (default), 1: active high, others: undefined.
|-
| 0x3b || power set on/off state powerupstate || 0: off, 1: on, others: undefined.
|}
= Usage =
Connect the raspberry pi to your raspberry juice by I2C or SPI. Take care that the "power" of the I2C or SPI connector on the 'juice is connected to the 5V of the 'pi. Connecting it to the 3.3V supply rails will most likely end in disaster.
Now connect the adapter that you normally use to power the 'pi to the USB connector on raspberry juice board. The raspberry pi should start to boot.
=== User input ===
If you hit the button on the 'juice the power to the 'pi will toggle. It is better not to do this when the 'pi is on, but you can force a shutdown this way, just like pulling the power cord.
When the 'pi is off, the 'juice will go into a power-saving mode. It will only test the button a few times per second. In this situation it is possible to press-and-release the button between two checks by the 'juice. To prevent this, you need a slightly longer press.
=== Software control ===
You can use SPI or I2C to tell the 'juice to do things with the power to the 'pi. First of all, writing a 32-bit integer to register 0x20 and 0x21 will schedule a power-down and a subsequent power-up after the specified number of miliseconds. This way you can put your 'pi to deep-sleep under software-control, and schedule a wakeup at some future time. An example might be that you have to perform a certain task every hour, but that task only takes a few minutes. So after performing the task, the 'pi will schedule a "poweron" event after about 60 minutes, perform a clean shutown, and then request a powerdown in the shutdown-procedure.
=== Halting the 'pi ===
In the function "do_stop () " in the file /etc/init.d/halt, just before the last line that has "halt" in it you can add:
bw_tool -I -D /dev/i2c-1 -a a4 -W 20:800:i
this will powerdown the 'pi 2048 miliseconds after executing this command. This gives the 'pi time to finish the shutdown procedure, and then cuts the power.
Or you could write a 0 to register 0x33. That would immediately turn off the power.
=== Setting powerup-defaults ===
The module has to know what to do when IT first receives power. So you can write to registers 0x38 through 0x3b to set the default values that get loaded into the variables at 0x30-0x33 at powerup. The values you set are stored in eeprom and will be used on the next boot.
=== Sensitivity to inputs ===
The board can listen to the button on the board, as well as the external input. You could, for example, tell the board not to listen to the button while the 'pi is running. Then just before shutting down you enable the button again, and tell the 'juice to cut the power.
There is also an external input. You could connect an external switch, or drive it from some other source. Either the UP or the DOWN transition is considered an activation. You can set which one with the polarity variable.
= Examples =
So, for instance, writing 10000 to port 0x21 and 1000 to 0x20 will cut the power in 1 second, and then turn on the power 9 seconds later.
bw_tool -I -D /dev/i2c-1 -a a4 -W 21:2710:i 20:3e8:i
Note that bw_tool works with hexadecimal numbers. So 2710(hex) is 10000 decimal, and 3e8 is 1000 decimal.
Explanation of the command:
* -I and -D /dev/i2c-1 specify that the module is the I2C version. If you use SPI0, you can leave these off. When you use SPI1, you would specify -D /dev/spidev0.1
* -a a4 specifies the address of the module on the bus. 0xa4 is the 'juice address. You could change this, but this is usually not necessary (it does not make sense to have more than one of these modules).
* -W specifies that you want to write to an address.
* 21:2710:i is the register, 21, the value 0x2710 = 10000, and the datatype i=32-bit-integer.
* 20:3e8:i is the register, 20, the value 0x3e8 = 1000, and the datatype i=32-bit-integer.
d922360501aa65050801d2d38bf3f607b419e2e5
User Interface
0
1505
3532
3432
2015-11-11T10:56:48Z
Cartridge1987
2553
/* jumper settings */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board. That can be found in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=user%20interface BitWizard shop].
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just use:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
45be44c7b2e9e7307aae6263065e69b8e00734cd
3533
3532
2015-11-11T10:57:05Z
Cartridge1987
2553
/* write ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board. That can be found in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=user%20interface BitWizard shop].
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== Write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just use:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
d48ff88b00bccec63a04df462f88919c60d9670f
3534
3533
2015-11-11T10:57:15Z
Cartridge1987
2553
/* read ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board. That can be found in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=user%20interface BitWizard shop].
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== Write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== Read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just use:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= examples =
== read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
58c918abe3e8510920d452cc568f36084c295e65
3535
3534
2015-11-11T10:57:53Z
Cartridge1987
2553
/* examples */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board. That can be found in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=user%20interface BitWizard shop].
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== Write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== Read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just use:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= Examples =
== Read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== Set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
6482895020b9e3f7818e4030735fab277f5ec567
7 Segment
0
1556
3536
2507
2015-11-11T10:58:15Z
Cartridge1987
2553
/* jumper settings */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
There are no LEDs, except for the display of course.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny48 on the board.
== Programming ==
== The software ==
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x10 || Write a bitmap to the display (see [[#bitmap]]) (4 bytes)
|-
| 0x11 || Write a hexadecimal number to the display (4 bytes)
|-
| 0x12 || write 0x01 to store the current display as startup display. Write 0x00 to return to the default.
|-
| 0x20 .. 0x23 || Write a bitmap to only 1 character
|-
| 0x30 .. 0x33 || Write a hexadecimal numer to only 1 character
|-
| 0x40 || Write a value other then 0x00 to light the bottom dot, 0x00 turns it off.
|-
| 0x41 || Write a value other then 0x00 to light the upper dot, 0x00 turns it off.
|-
| 0x42 || Write a value other then 0x00 to light both dots, 0x00 turns them off.
|-
| 0xf0 || change address.
|}
=== read ports ===
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || Return the entire bitmap (see [[#bitmap]]) (4 bytes)
|-
| 0x20 .. 0x23 || Return the bitmap of 1 character
|}
=== Bitmap ===
It is possible to tell the module to not show a hexadecimal digit, but to display a user-defined digit.<br>
The most significant bit in this bitmap controls segment A, and the least significant bit controls one of the dots. The lower dot is controlled by digit 2, and the upper dot by digit 3.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
37e0e40ecc47f2833eba31bd088ef20839932b6b
3537
3536
2015-11-11T10:58:34Z
Cartridge1987
2553
/* The software */
wikitext
text/x-wiki
[[File:spi_7segment.jpg|thumb|300px|alt=spi_7segment|The 7_segment board (depicted: the SPI version)]]
This is the documentation page for the 7_segment boards.
== Overview ==
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
There are no LEDs, except for the display of course.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny48 on the board.
== Programming ==
== The software ==
=== Write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x10 || Write a bitmap to the display (see [[#bitmap]]) (4 bytes)
|-
| 0x11 || Write a hexadecimal number to the display (4 bytes)
|-
| 0x12 || write 0x01 to store the current display as startup display. Write 0x00 to return to the default.
|-
| 0x20 .. 0x23 || Write a bitmap to only 1 character
|-
| 0x30 .. 0x33 || Write a hexadecimal numer to only 1 character
|-
| 0x40 || Write a value other then 0x00 to light the bottom dot, 0x00 turns it off.
|-
| 0x41 || Write a value other then 0x00 to light the upper dot, 0x00 turns it off.
|-
| 0x42 || Write a value other then 0x00 to light both dots, 0x00 turns them off.
|-
| 0xf0 || change address.
|}
=== Read ports ===
The 7_segment board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || Return the entire bitmap (see [[#bitmap]]) (4 bytes)
|-
| 0x20 .. 0x23 || Return the bitmap of 1 character
|}
=== Bitmap ===
It is possible to tell the module to not show a hexadecimal digit, but to display a user-defined digit.<br>
The most significant bit in this bitmap controls segment A, and the least significant bit controls one of the dots. The lower dot is controlled by digit 2, and the upper dot by digit 3.
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ecd6a7eeef746842f307c404453a6a23612243f8
Pushbutton
0
1557
3538
2577
2015-11-11T10:58:53Z
Cartridge1987
2553
/* jumper settings */
wikitext
text/x-wiki
[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]]
This is the documentation page for the pushbutton boards.
== Overview ==
This board adds 4 pushbuttons to your I2C or SPI enabled device.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI0 into an ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
|-
| 0xf0 || change address.
|}
=== read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all buttons
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
581f1149273d43fa4fec648ed5799911eba74a04
3539
3538
2015-11-11T10:59:12Z
Cartridge1987
2553
/* The software */
wikitext
text/x-wiki
[[File:spi_pushbutton.jpg|thumb|300px|alt=spi_pushbutton|The pushbutton board (depicted: the SPI version)]]
This is the documentation page for the pushbutton boards.
== Overview ==
This board adds 4 pushbuttons to your I2C or SPI enabled device.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI0 into an ICSP programming connector for the attiny44 on the board.
== Programming ==
== The software ==
Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== Write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The pushbutton board defines just one port.
{| border=1
! port !! function
|-
| 0xf0 || change address.
|}
=== Read ports ===
The pushbutton board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x10 || read all buttons
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|}
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
2d0c556ea98d54becd0b5a35f3548a4efe914e6b
16 LEDs
0
54
3540
3428
2015-11-11T10:59:37Z
Cartridge1987
2553
/* testing */
wikitext
text/x-wiki
[[File:16-LEDs.jpg|thumb|300px|alt=The 16_LEDs PCB|The 16_LEDs PCB]]
This is the documentation page for the 16-LEDs board. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/dio-leds BitWizard shop].
== Overview ==
A very useful board to test your digital outputs. Works on 5V as well as 3.3V so for the DIO as well as the Pi GPIO pins.<br>
Must have! Use the 10x1Pin F-F kabel to hook it up to the boards (e.g. i2c_dio or spi_dio). Or if your board has a 10x2 pin header, you can use a 20pin IDC cable.
== Assembly instructions ==
No user adjustable settings.
=== Possible Configurations ===
The 16-leds board can be ordered in two versions. The common-anode version will connect all the anodes to VCC (pin 19,20) and the leds via a resistor to the 16 inputs (pin 3-18). This means that the led will light up if you drive the input pin (3-19) LOW. This is useful for open collector outputs. However usually this results in inverted logic: the led lights when the signal is low.
Most people will want the common-cathode version. This connects all the cathodes to GND (pin 1/2) and then all the inputs to the leds. This results in normal logic: the leds light up if the signal is high.
=== Testing ===
To test the 16LED, connect the GND (pin 1 or 2) to any of the GND pins on your board.
Next take a 5V (or 3.3V) wire (pin 2 on DIO) and connect it one at a time to pin 3, 4, and so on. You can use a power supply pin or a pin programmed to "high". Each time you touch one of the inputs, one of the leds should light up.
== External resources ==
=== Related projects ===
== Pinout ==
{| border=1 cellpadding="5"
! colspan="2" | pin || ! colspan="2" | function
|-
| 1 || 2 || GND || GND
|-
| 3 || 4 || LED0 || LED1
|-
| 5 || 6 || LED2 || LED3
|-
| 7 || 8 || LED4 || LED5
|-
| 9 || 10 || LED6 || LED7
|-
| 11 || 12 || LED8 || LED9
|-
| 13 || 14 || LED10 || LED11
|-
| 15 || 16 || LED12 || LED13
|-
| 17 || 18 || LED14 || LED15
|-
| 19 || 20 || VCC || VCC
|}
== Jumper settings ==
<b>Common Ground/Common VCC</b> is hard wired in JP1.
<table>
<tr><td> 1=2 3</td><td>Common GND / kathode</td></tr>
<tr><td> 1 2=3 </td><td>Common VCC / anode</td></tr>
</table>
== Future hardware enhancements ==
The jumper is not much use: If you have the common cathode version the jumper must connect the common rail to GND, and if you have the common anode version, you must connect it to VCC. Therefore it makes more sense to make this a solder-jumper. It makes sense to design the board to have the GND signal the default because most people will want the normal-logic version i.e. the common cathode.
== Changelog ==
=== 2.0 ===
* Initial public release
170dfda6f1fddf48785a082af2df3931603d41a0
USB-SATA powerswitch
0
7
3541
3439
2015-11-11T11:00:41Z
Cartridge1987
2553
/* overview */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
You can buy the USB SATA powerswitch in the [http://www.bitwizard.nl/shop/usb-boards/usb-sata-powerswitch BitWizard shop].
== Overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
1fb67cc74947a948abefff41ebaf31634f6e1d09
3542
3541
2015-11-11T11:00:54Z
Cartridge1987
2553
/* pinout */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
You can buy the USB SATA powerswitch in the [http://www.bitwizard.nl/shop/usb-boards/usb-sata-powerswitch BitWizard shop].
== Overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== Pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
d884ddc88db1a4449a09c4b4c1444c079e5fc1fe
3543
3542
2015-11-11T11:01:11Z
Cartridge1987
2553
/* programming */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
You can buy the USB SATA powerswitch in the [http://www.bitwizard.nl/shop/usb-boards/usb-sata-powerswitch BitWizard shop].
== Overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== Pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
f4f0721a56e9340df9042e259ebb5023a9ad16b1
3544
3543
2015-11-11T11:01:25Z
Cartridge1987
2553
/* writing programs */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
You can buy the USB SATA powerswitch in the [http://www.bitwizard.nl/shop/usb-boards/usb-sata-powerswitch BitWizard shop].
== Overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== Pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
cd88bf3c3ee3d42fa22769af15898ed41b739d14
3545
3544
2015-11-11T11:01:38Z
Cartridge1987
2553
/* future hardware enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
You can buy the USB SATA powerswitch in the [http://www.bitwizard.nl/shop/usb-boards/usb-sata-powerswitch BitWizard shop].
== Overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== Pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== Future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
63ca4722a62d852c071b9ba177ba2470f1058b89
3546
3545
2015-11-11T11:01:47Z
Cartridge1987
2553
/* future software enhancements */
wikitext
text/x-wiki
= USB SATA powerswitch =
This is the documentation page for the USB SATA powerswitch PCB. The firmware was updated around Nov 2014. If you have yours since longer ago, look here: [[Old USB-SATA powerswitch]]
The old firmware used single character commands (s, c), the new version uses "words" (set/clear).
You can buy the USB SATA powerswitch in the [http://www.bitwizard.nl/shop/usb-boards/usb-sata-powerswitch BitWizard shop].
== Overview ==
The USB SATA powerswitch PCB has an USB connector and connection points for 3 power rails. The brains of the PCB is an at90usb162 (or compatible) chip.
The 12V power rail is switched with an IRF9333 FET, and the 5V and 3,3V rails are switched with FDS8884 FETs.
== External resources ==
== Pinout ==
* led1 is connected to VCC
* led2 is connected to PD6
* led3 is connected to PD5
* led4 is connected to PD4
* led5 is connected to PD3
* led6 is connected to PD0 (12V FET)
* led7 is connected to PD1 (5V FET)
* led8 is connected to PD2 (3,3V FET)
* led9 is connected to 12V in
* led10 is connected to 5V in
* led11 is connected to 3,3V in
Viewing with the USB connector on the left side, and the power pads on the lower side:
* 12V IN
* 12V OUT
* GND
* GND
* 5V IN
* 5V OUT
* GND
* GND
* 3,3V IN
* 3,3V OUT
== Default operation ==
The device acts as a usb-serial port, and under Linux, will be available under /dev/ttyACMn (n=0 for the first device, 1 for the second, etc.).
At BitWizard, we use the following script for turning om our harddisks:
#!/bin/sh
tty=/dev/ttyACM0
stty -echo -icrnl -onlcr < $tty
cat $tty &
pid=$!
(sleep 0.2; echo set 0 ; sleep 0.2 ; echo set 1 ; sleep 0.2 ; echo set 2 ) > $tty
sleep 0.5
kill $pid
"set 0" means "set output zero", which is the 12V output. "set 1" id the 5V output, and "set 2" is the 3V3 output. The four extra status LEDs are connected to output 3,4, 5, and 6.
To turn off an output, simply send "clear 0", meaning "clear output zero".
Note that we start with output zero, or the 12V. We have experienced that harddrives will powerdown nicely (i.e. not burn down in flames) when you keep 12V powered and interrupt the 5V supply. So powering up the drive by bringing up the 12V and then the 5V should work. Below you see that John does things the other way around. Apparently that too doesn't cause immidate problems. BitWizard recommends powering up the 12V first, and then the other power rails. But if you want to do otherwise, feel free. Powering down we recomend inverting the powerup sequence. 3.3V first, 5V next, 12V last.
Reading from the device is necessary, because it needs to put its output somewhere. If you don't read it's output, the device may (or will) freeze.
John tells us that he uses the following windows script.
::startsatabat
::port parameters
MODE COM3:96,N,8,1
::For reading info from COM port
type COM3
::For sending info to COM port
sleep -m 200
echo set 2 > COM3
sleep -m 200
echo set 1 > COM3
sleep -m 200
echo set 0 > COM3
The "type COM3" line is controversial. I would expect that line to block and the script to stop processing there. On windows, it seems it works fine without it. Then, I think John put the line back, but maybe as "copy com3: con:". Apparently that does not block. Please let us know how your experience is.
The parameters like "baud rate" and parity are ignored in the device. I don't see the need for the "mode com3:96,N,8,1" line. Maybe the act of initializing is neccessary on windows. Or maybe it resets other parameters like is neccessary on Linux. (On Linux the echo '''needs''' to be off: otherwise the first character that is echoed from the device back to the PC starts bouncing back and forth between the PC and the device).
The devices are shipped with the following .hex file programmed:<br>
[[file:Usb-sata_powerswitch.hex]]<br>
For info on how to flash this .hex into your controller, see the section on programming below.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. [[https://dfu-programmer.github.io/]]
On sufficiently recent Ubutnu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Hacking ==
If you want to switch other things than a harddisk, keep in mind that the 12V is switched with a P-fet that is spec-ed for >10V VGS operation. So reducing the 12V to something else is not recommended.
Similarly, the 5V and 3.3V outputs are switched by logic level N-FETS which are driven with their gates to 12V. So for the 5V output the drive on the gate is 7V. As this is a logic-level N-FET, this works just fine. But increase the switched voltage on the 5V line to more than 8V and things become critical.
== Future hardware enhancements ==
* Replace the SMD inductor with an TH version (1.3: Done!)
== Future software enhancements ==
* program the LUFA bootloader.
== Changelog ==
1.3
* Moved to screw terminals for the power connections.
1.2
* ??
1.1
* Switched order of 12V pads, so that the input and output are in the same order as the 5V and 3V3 pads.
* replaced the SMD switch with an TH version
* Added mounting holes
1
* Initial release
c14abea8aa82477bc0f4c62ea1077558d6f3af28
USB-opto
0
8
3547
3437
2015-11-11T11:02:10Z
Cartridge1987
2553
/* overview */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-optocoupler BitWizard shop].
== Overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
8c4cd3f6ca3fe48c96dfe9555088f123cd3bf17c
3548
3547
2015-11-11T11:02:26Z
Cartridge1987
2553
/* pinout */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-optocoupler BitWizard shop].
== Overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== Pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
c621d0bb380061da15dbcd0b8cec03911e905163
3549
3548
2015-11-11T11:02:43Z
Cartridge1987
2553
/* programming */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-optocoupler BitWizard shop].
== Overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== Pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
ef6c8b530857ad6f91ad7fe5cec50f4fa76f814a
3550
3549
2015-11-11T11:02:54Z
Cartridge1987
2553
/* writing programs */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-optocoupler BitWizard shop].
== Overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== Pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
f84a0d669d1e8973ccd2b6585d2a312e6f301b66
3551
3550
2015-11-11T11:03:03Z
Cartridge1987
2553
/* future hardware enhancements */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-optocoupler BitWizard shop].
== Overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== Pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Future hardware enhancements ==
* Make an ICSP connector.
== future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
ba63f7013bea6c4f58bb380413bc63ef3099bd3a
3552
3551
2015-11-11T11:03:11Z
Cartridge1987
2553
/* future software enhancements */
wikitext
text/x-wiki
= USB-opto =
This is the documentation page for the USB-opto PCB.
That you can buy in the [http://www.bitwizard.nl/shop/usb-boards/usb-optocoupler BitWizard shop].
== Overview ==
The USB-opto PCB has an USB connector and two 16-pin connectors. The brains of the PCB is an at90usb162 (or compatible) chip.
== External resources ==
== Pinout ==
The 16 pin connectors are connected as follows
<table border=1>
<tr><td>1</td><td>Emitter opto 2A</td></tr>
<tr><td>2</td><td>Collector opto 2A</td></tr>
<tr><td>3</td><td>Emitter opto 1A</td></tr>
<tr><td>4</td><td>Collector opto 1A</td></tr>
<tr><td>5</td><td>Emitter opto 2B</td></tr>
<tr><td>6</td><td>Collector opto 2B</td></tr>
<tr><td>7</td><td>Emitter opto 1B</td></tr>
<tr><td>8</td><td>Collector opto 1B</td></tr>
<tr><td>9</td><td>Emitter opto 2C</td></tr>
<tr><td>10</td><td>Collector opto 2C</td></tr>
<tr><td>11</td><td>Emitter opto 1C</td></tr>
<tr><td>12</td><td>Collector opto 1C</td></tr>
<tr><td>13</td><td>Emitter opto 2D</td></tr>
<tr><td>14</td><td>Collector opto 2D</td></tr>
<tr><td>15</td><td>Emitter opto 1D</td></tr>
<tr><td>16</td><td>Collector opto 1D</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
== Default operation ==
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Future hardware enhancements ==
* Make an ICSP connector.
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
2.0
* Initial public release
b07e5926740590e4c9f08379b3a00e476256697f
IO Expander
0
1682
3553
2762
2015-11-11T11:03:42Z
Cartridge1987
2553
/* general info */
wikitext
text/x-wiki
= General info =
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf <br>
<br>
I2C address:<br>
0100 000 tru 0100 111 (jumper selectable)<br>
<br>
SPI address:<br>
0100 000 tru 0100 011 (jumper selectable)<br>
= physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= using the board =
5a9e7ddf8518eb65b28a51bf412f41c10d83595d
3554
3553
2015-11-11T11:03:50Z
Cartridge1987
2553
/* physical dimensions */
wikitext
text/x-wiki
= General info =
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf <br>
<br>
I2C address:<br>
0100 000 tru 0100 111 (jumper selectable)<br>
<br>
SPI address:<br>
0100 000 tru 0100 011 (jumper selectable)<br>
= Physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= using the board =
3d4cba4c3689900d9a0aa28dd0ad3b1d6b5f3cec
3555
3554
2015-11-11T11:03:58Z
Cartridge1987
2553
/* using the board */
wikitext
text/x-wiki
= General info =
Based on the MCP23008 (I2C) or MCP23S08 (SPI) IO expander chips from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf <br>
<br>
I2C address:<br>
0100 000 tru 0100 111 (jumper selectable)<br>
<br>
SPI address:<br>
0100 000 tru 0100 011 (jumper selectable)<br>
= Physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= Using the board =
ff1d1e40e775bf5751928b4b0f1e46c59f967542
SPI DAC
0
1685
3556
2755
2015-11-11T11:04:10Z
Cartridge1987
2553
/* general info */
wikitext
text/x-wiki
= General info =
Based on the MCP4822 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21953a.pdf
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= using the board =
65cdb17e2bb35b2170bb0703e3adc2fe072c38de
3557
3556
2015-11-11T11:04:18Z
Cartridge1987
2553
/* physical dimensions */
wikitext
text/x-wiki
= General info =
Based on the MCP4822 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21953a.pdf
= Physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= using the board =
9e392eaf697d52c2452d1e80f6b36469a70d5e9e
3558
3557
2015-11-11T11:04:26Z
Cartridge1987
2553
/* using the board */
wikitext
text/x-wiki
= General info =
Based on the MCP4822 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/21953a.pdf
= Physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= Using the board =
f8ed0c7b9c264b2d79f070a9438c7113210bece2
Iphone 3GS camera
0
611
3559
1045
2015-11-11T11:05:18Z
Cartridge1987
2553
/* intro */
wikitext
text/x-wiki
== Intro ==
I bought an Iphone 3GS camera module as it is cheap, and I expected to be able to interface it with something, probably an FPGA.
== pinout ==
Getting the pinout is not easy.
The connector has a central part with 12 pins on each side and a further 4 pins on the corners. Those four pins on the corners are numbered 25 through 28. The other pins are numbered 1,3,5,...-23 on one side and 2,4,6,...-24 on the other side.
So far I've managed to find:
<table border=1>
<tr><td>1,2,7,8,10</td><td>GND</td></tr>
<tr><td>3,4,5,6</td><td>NC</td></tr>
<tr><td>9,11</td><td>DATAP0, DATAN0</td></tr>
<tr><td>13,16,17</td><td>GND</td></tr>
<tr><td>12</td><td>VCC 3.0V</td></tr>
<tr><td>14</td><td>RESETN</td></tr>
<tr><td>15</td><td>VCC 1.8V ?</td></tr>
<tr><td>18</td><td>CLK</td></tr>
<tr><td>19,21</td><td>PCLKP, PCLKN</td></tr>
<tr><td>20</td><td>SCL</td></tr>
<tr><td>22</td><td>SDA</td></tr>
<tr><td>23,24</td><td>GND</td></tr>
<tr><td>25,26,27,28</td><td>GND</td></tr>
</table>
This makes me think: The pixel data is transferred serially. Configuration data is transferred using I2C.
346e3d02010efbf36b7c942b389cba4dec513e1b
3560
3559
2015-11-11T11:05:28Z
Cartridge1987
2553
/* pinout */
wikitext
text/x-wiki
== Intro ==
I bought an Iphone 3GS camera module as it is cheap, and I expected to be able to interface it with something, probably an FPGA.
== Pinout ==
Getting the pinout is not easy.
The connector has a central part with 12 pins on each side and a further 4 pins on the corners. Those four pins on the corners are numbered 25 through 28. The other pins are numbered 1,3,5,...-23 on one side and 2,4,6,...-24 on the other side.
So far I've managed to find:
<table border=1>
<tr><td>1,2,7,8,10</td><td>GND</td></tr>
<tr><td>3,4,5,6</td><td>NC</td></tr>
<tr><td>9,11</td><td>DATAP0, DATAN0</td></tr>
<tr><td>13,16,17</td><td>GND</td></tr>
<tr><td>12</td><td>VCC 3.0V</td></tr>
<tr><td>14</td><td>RESETN</td></tr>
<tr><td>15</td><td>VCC 1.8V ?</td></tr>
<tr><td>18</td><td>CLK</td></tr>
<tr><td>19,21</td><td>PCLKP, PCLKN</td></tr>
<tr><td>20</td><td>SCL</td></tr>
<tr><td>22</td><td>SDA</td></tr>
<tr><td>23,24</td><td>GND</td></tr>
<tr><td>25,26,27,28</td><td>GND</td></tr>
</table>
This makes me think: The pixel data is transferred serially. Configuration data is transferred using I2C.
caacb1c075b2a0e32bf2b2a8aee8ad2679e33242
Temperature control
0
601
3561
1034
2015-11-11T11:07:14Z
Cartridge1987
2553
/* writing the software */
wikitext
text/x-wiki
= intro =
I wanted to demonstrate that temperature control using three of our boards would be easy. I will replicate this experiemnt at home to make a "sous vide" setup shortly.
= Putting the hardware together =
I took my ftdi_atmega
[[File:tempcontroller_01_ftdi_atmega.jpg|200px|thumb|none|FTDI ATMEGA PCB]]
and used a standard 6 pin SPI cable to connect it to my spi_temp board.
[[File:tempcontroller_02_spi_temp.jpg|200px|thumb|none|spi_temp board]]
The spi cable was then daisychained to the next board: spi_relay
[[File:tempcontroller_03_spi_relay.jpg|200px|thumb|none|spi_relay board]]
The Relay was hooked up to an extension cord. This way the relay would control the power to the extension cord.
[[File:tempcontroller_04_relay_and_extensioncord.jpg|200px|thumb|none|spi_relay and the extension cord]]
Next I hooked up the coffee pot to the extension cord.
[[File:tempcontroller_05_coffee_pot.jpg|200px|thumb|none|coffee machine]]
and I extended the LM35 sensor (and waterproofed it). I put the sensor in the water in the coffee pot.
= Writing the software =
I took the spi_atmega demo application, and modified it to add temperature control. This was really easy:
<code>
if (wanted_temp && tchanged) {
long t0;
unsigned char heater;
static unsigned char curheater = -1;
t0 = SPI_getu16 (SPI_TEMP, 0x28);
//pputs ("t0 = ");hexshort (t0);
t0 = (t0 * 1000/11) >> 16;
// pputs (" t0 = ");hexshort (t0);
heater = (t0 < wanted_temp);
pputs (" t0 = ");hexshort (t0);
pputs (" wt = ");hexbyte (wanted_temp);
pputs (" heat = ");hexbyte (heater);
pputs (".\n\r");
if (curheater != heater) {
spi_setreg_u8 (SPI_RELAY, 0x20, heater);
curheater = heater;
pputs ("Turned heater ");
if (heater) pputs ("on");
else pputs ("off");
pputs ("\r\n");
}
}
</code>
This gets executed every second (because of the tchanged), It gets the temperature reading, converts it to centigrade and then compares it with the wanted temperature. In the mean time it logs some variables for debugging.
This is very simple on-off control. This, it turns out is not ideal with the slow response of the coffee machine. The temperature overshoots the intended temperature by quite a lot. This can be fixed by using a proper PID control algorithm. With a different heater setup this would not be necessary.
f532e5f4361888bdf781cee571cba24c57eb8ff3
I2C DAC
0
1679
3562
2766
2015-11-11T11:07:44Z
Cartridge1987
2553
/* general info */
wikitext
text/x-wiki
= General info =
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
You can order both versions. The addresses of your board can be found on the bottom side.
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= using the board =
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 (or 0x62 and 0x63) for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
b0e5384bff0fb4c6ada15e148ab64e868279b57c
3563
3562
2015-11-11T11:07:56Z
Cartridge1987
2553
/* using the board */
wikitext
text/x-wiki
= General info =
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
You can order both versions. The addresses of your board can be found on the bottom side.
= physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= Using the board =
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 (or 0x62 and 0x63) for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
3fb27fbfe632a2948b53ef494ee6ab213c013de4
3564
3563
2015-11-11T11:08:06Z
Cartridge1987
2553
/* physical dimensions */
wikitext
text/x-wiki
= General info =
Based on the MCP4726 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22272C.pdf <br>
<br>
I2C address:<br>
1100 000 and 1100 001 '''OR'''<br>
1100 010 and 1100 011<br>
You can order both versions. The addresses of your board can be found on the bottom side.
= Physical dimensions =
* Board outline: 25x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 19x19mm (3mm from board edge)
= Using the board =
Set a voltage:
sudo i2cset -y 1 0x60 0x40 0xff 0xf0 i
^^ ^ < Voltage bits
explanation of the arguments:
-y don't ask confirmation
1 number of the I2C bus (0 on older raspberry pi's)
0x60 address of the DAC, use 0x61 (or 0x62 and 0x63) for the other DAC.
0x40 configuration: normal.
0xff high 8 bits of the value
0xf0 lower four bits of the value (in the high nibble)
3956aac905274eb31a6dc9be790b26bb8ebcec79
I2C ADC
0
1684
3565
2760
2015-11-11T11:08:22Z
Cartridge1987
2553
wikitext
text/x-wiki
= General info =
Based on the MCP3424 chip from Microchip.<br>
http://ww1.microchip.com/downloads/en/DeviceDoc/22088b.pdf<br>
<br>
I2C address:<br>
1101 000 tru 1101 011 (jumper selectable)<br>
= Physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44mmx19mm (3mm from board edge)
= Using the board =
c1f0232c69922d96ef1a488e591214e7ee799291
I2C splitter
0
1683
3566
3430
2015-11-11T11:08:57Z
Cartridge1987
2553
wikitext
text/x-wiki
The I2C splitter can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/i2c-splitter-PCA9548A BitWizard shop].
= General info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= Physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= Pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
[[File:Dsc05850_edit.jpg|thumb|500px|alt=The annotated i2c_splitter board|The i2c_splitter board]]
The "Vout" connector provides GND/AUX/VCC. By placing a jumper on AUX/VCC, you can configure your slave I2C busses to use the same power supply as your main VCC (usually 5V or 3.3V). If you require a different voltage, you can apply that voltage using a two-pin connector using GND/AUX on the same connector. If you ordered the special version prepared for a specific output voltage, no connection/jumper is necessary on the VOUT connector. You can measure the output voltage on the AUX pin if you want (there are 8 other pins that make this voltage available, but it's there. :-) )
= Jumpers =
== Address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your master is 5V and your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= Using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
21e33c1f54bce35fa84fc8434ad1c98216a66d45
I2C accellerometer
0
1768
3567
3097
2015-11-11T11:09:31Z
Cartridge1987
2553
wikitext
text/x-wiki
= General info =
The I2C accellerometer is based on the MMA8652 from freescale.
= Pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC.
== Voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....)
= Examples =
This is a sample script that runs on raspberry pi to extract the X, Y and Z accellerometer values. It requires you install the bw_tool.
#!/bin/sh
acc="bw_tool -I -D /dev/i2c-1 -a 3a"
# reset the accelerometer.
$acc -W 2b:40:b
# minimum 1ms IIRC.
sleep 0.01
#
#select range=1 for +/- 4G fs range.
#range=1
range=0
#
$acc -W 0e:"$range":b 2b:2:b 2c:0:b 2d:1:b 2e:1:b 2a:39:b
sleep 1
#$acc -R 0:l
result=`$acc -R 0:l |sed -e 's/\(..\)/\1 /g' `
#echo $result
x=`echo $result | awk '{print $7$6}'`
y=`echo $result | awk '{print $5$4}'`
z=`echo $result | awk '{print $3$2}'`
echo x=$x y=$y z=$z
The numbers are presented in hex. Remember that (in the default +/-2G fs range) 4000 is one G, c000 is about minus one G.
Mine currently reports:
x=0c70 y=0580 z=3f30
so it is not quite flat (X and Y significantly differ from zero. I get about +/- 60 when its pressed to the table). but it is still registering almost a full G in the Z direction .
= Datasheets =
[[http://cache.freescale.com/files/sensors/doc/data_sheet/MMA8652FC.pdf]]
f13ba52e1a421191a101444c0f36949750c61fc4
I2C magnetometer
0
1769
3568
3098
2015-11-11T11:09:57Z
Cartridge1987
2553
wikitext
text/x-wiki
= General info =
The I2C magnetometre is based on the MAG3110 from freescale.
= Pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC.
== Voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....)
= Examples =
This is a sample script that runs on raspberry pi to extract the X, Y and Z magneto values. It requires you install the bw_tool.
#!/bin/sh
mag="bw_tool -I -D /dev/i2c-1 -a 1c"
$mag -W 10:2:b
sleep 0.1
result=`$mag -R 0:l |sed -e 's/\(..\)/\1 /g' `
#echo $result
x=`echo $result | awk '{print $7$6}'`
y=`echo $result | awk '{print $5$4}'`
z=`echo $result | awk '{print $3$2}'`
echo x=$x y=$y z=$z
The numbers are presented in hex. The magnetic field of the earth is in fact quite small. (your nails don't pop out of the wall if they align with the magnetic field do they?) So the measurement requires some calibration, but the values do change when you change the orientation of the device.
= Datasheets =
[[http://cache.freescale.com/files/sensors/doc/data_sheet/MAG3110.pdf]]
dc33d4e7dd2f4c616ce67da440494c3469434a5e
I2C pressure sensor
0
1770
3569
3112
2015-11-11T11:10:28Z
Cartridge1987
2553
wikitext
text/x-wiki
= General info =
The I2C pressure sensor is based on the MS5637 from Measurement Specialties. It can be found on address 0xEC (7 bit address: 0x76). More info about 7 bit and 8 bit address can be found on the following page: [[I2c_addresses]]
= Pinout =
As with all bitwizard I2C boards, the board has a 4 pin female connector on the left and a male connector on the right so that you can daisychain multiple boards.
The pinout is GND, SDA, SCL, VCC. (with a bit of luck this is now silk-screened on the back of the board.)
== Voltages ==
The chip is 3.3V, a regulator is provided on board. This regulator has a dropout of about 1V, so the board currently requires a 5V nominal VCC. We'll move to a different regulator one of these days allowing clean 3.3V operation. (the dropout will be so low that the chip will have to make do with 3.299V if you provide 3.300V....). The chip can handle 4k7 pullups to 5V on the I2C bus.
= Examples =
This is an example arduino sketch that prints the pressure every second.
#include <Wire.h>
#include <BaroSensor.h>
void setup()
{
Serial.begin(9600);
BaroSensor.begin();
}
void loop()
{
float temp, pres;
if(!BaroSensor.isOK()) {
Serial.print("Sensor not Found/OK. Error: ");
Serial.println(BaroSensor.getError());
BaroSensor.begin(); // Try to reinitialise the sensor if we can
} else {
temp = BaroSensor.getTemperature();
pres = BaroSensor.getPressure();
Serial.print (millis ());
Serial.print (" ");
// Serial.print("T: ");
Serial.print(temp);
// Serial.print(" P: ");
Serial.print (" ");
Serial.println(pres);
}
delay (1000);
}
= Datasheets =
[[http://www.farnell.com/datasheets/1756129.pdf]]
cd8bc8c449a2f62c11e0d6a187ce8b2df081089d
Raspberry Pi Serial
0
59
3570
3416
2015-11-11T11:11:13Z
Cartridge1987
2553
/* signal levels */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
You can find the Raspberry Pi Serial board in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=Bob BitWizard shop].
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
=== Signal levels ===
Many expansion boards that you might want to connect to your raspberry pi will be 5V, whereas the Raspberry Pi works at 3.3V. To convert the signal levels you need a level shifter.
For I2C the board implements a level shifter as recommended by Philips (inventor of I2C).
For SPI and UART the 3.3V signals coming out of the Raspberry Pi are sufficiently high that all 5V devices that we could find recognized the signal as high. For the 5V signals going to the Raspberry Pi, we have limited the voltage to just above 3.3V by putting a scottky diode from the signal to the 3.3V, as well as a 1k resistor to limit the current. This sufficiently protects the raspberry pi from damage by the 5V signals from 5V devices.
Some care should be taken: The 5V device should NOT drive the signals that are normally driven by the raspberry pi. Normally you'd have two outputs driving against eachother, now there is also the 5V vs 3.3V issue....
== Pinout ==
The 26 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools .
git clone https://github.com/rewolff/bw_rpi_tools.git
Now, you can use the tools in either the SPI or I2C subdirectory to communicate with bitwizard SPI or I2C boards that you might have.
== getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== changelog ===
* Initial public release
67f7662545c8986f155b57509758e96090d666a4
3571
3570
2015-11-11T11:11:26Z
Cartridge1987
2553
/* getting SPI and I2C drivers to work on raspian */
wikitext
text/x-wiki
[[File:rpi_serial.jpg|thumb|300px|alt=The Raspberry Pi Serial board|The Raspberry Pi Serial board]]
This is the documentation page for the Raspberry Pi Serial board.
The RPI_SERIAL board breaks out the serial busses on the raspberry pi. This allows the raspberry pi to communicate at 3.3V CMOS levels with say an arduino mini or other 3.3V asynchronous devices. But also the I2C bus and SPI busses are broken out. BitWizard has a bunch of expansion boards that can connect to those busses.
You can find the Raspberry Pi Serial board in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=Bob BitWizard shop].
This page will say more about the hardware in the future, once things are tested. For now see [[Raspberry pi expansion system page]]
== Overview ==
The RPI_SERIAL board breaks out two SPI busses, the UART and the I2C bus of the BCM2835 SOC on the raspberry pi.
=== Possible Configurations ===
The board can be configured for EITHER 3.3V or 5V. This is done by moving a solder-jumper. See [[solder jumpers]] for how to move a solder jumper.
In contrast to the expansion boards that have a "default" setting for the solder jumper by having a small trace between two of the pads, the RPI_SERIAL boards have been designed to FORCE us to think about what option we want by not providing any default. So far most rpi_serial boards have been soldered for 5V prior to being shipped. Unless someone convinces us otherwise, this will probably remain like this.
If you remove the solder jumper and forget to put it back on in the other position (or if you fail to make the contact), the power led will not light.
=== Signal levels ===
Many expansion boards that you might want to connect to your raspberry pi will be 5V, whereas the Raspberry Pi works at 3.3V. To convert the signal levels you need a level shifter.
For I2C the board implements a level shifter as recommended by Philips (inventor of I2C).
For SPI and UART the 3.3V signals coming out of the Raspberry Pi are sufficiently high that all 5V devices that we could find recognized the signal as high. For the 5V signals going to the Raspberry Pi, we have limited the voltage to just above 3.3V by putting a scottky diode from the signal to the 3.3V, as well as a 1k resistor to limit the current. This sufficiently protects the raspberry pi from damage by the 5V signals from 5V devices.
Some care should be taken: The 5V device should NOT drive the signals that are normally driven by the raspberry pi. Normally you'd have two outputs driving against eachother, now there is also the 5V vs 3.3V issue....
== Pinout ==
The 26 pin gpio connector is described at elinux: [[http://elinux.org/RPi_Low-level_peripherals]]
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].
The I2C connector is documented here: [[I2C_connector_pinout]].
The UART connector is documented here: [[uart connector pinout]].
=== LEDs ===
There is one power led. (the current version of the board has "R5" silkscreened next to the footprint where we thing the led should be. We'll swap the led and resistor in the future.)
== Jumper settings ==
none (or see above for "configuration options").
== Programming ==
New: get bw_rpi_tools .
git clone https://github.com/rewolff/bw_rpi_tools.git
Now, you can use the tools in either the SPI or I2C subdirectory to communicate with bitwizard SPI or I2C boards that you might have.
== Getting SPI and I2C drivers to work on raspian ==
sudo wget https://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update
sudo rpi-update
will install the latest kernels with spidev support. Next comment out the two blacklist lines in /etc/modprobe.d/raspi-blacklist.conf:
sudo mv /etc/modprobe.d/raspi-blacklist.conf /etc/modprobe.d/raspi-blacklist.conf.orig
sudo sed -e 's/^b/#b/' /etc/modprobe.d/raspi-blacklist.conf.orig > /etc/modprobe.d/raspi-blacklist.conf
(you could do this with your favorite editor, but this way you can just cut-paste these lines and get it done....)
=== Changelog ===
* Initial public release
dd0cdf5441c5fa0b82d4f60768e9b05f6ec55327
USB Relay
0
1678
3572
3438
2015-11-11T11:15:02Z
Cartridge1987
2553
/* intro */
wikitext
text/x-wiki
== Intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
You can buy the USB Relay in the [http://www.bitwizard.nl/shop/usb-boards/usb-relay BitWizard shop].
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound. This has not been converted to a BAT file for windows yet.
For Windows users, there is an INF file in the zipfile. Tell windows that this is the driver for your device, and it will use the builtin driver to create a virtual comport. The "usbr.bat" script assumes this has become "COM3", but it could be a higher number. If so, you can adjust the script and change the default to whatever your comport has become, or use an environment variable. IIRC, you can add something like "set relayport=COM5" to your c:\autoexec.bat . It has been a long time since I worked with Windows. Please let me know if this works.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyACMx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
581e3185f861d2e8db89f6e5b3cdb7e66b1df6c8
3573
3572
2015-11-11T11:15:24Z
Cartridge1987
2553
/* button */
wikitext
text/x-wiki
== Intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
You can buy the USB Relay in the [http://www.bitwizard.nl/shop/usb-boards/usb-relay BitWizard shop].
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound. This has not been converted to a BAT file for windows yet.
For Windows users, there is an INF file in the zipfile. Tell windows that this is the driver for your device, and it will use the builtin driver to create a virtual comport. The "usbr.bat" script assumes this has become "COM3", but it could be a higher number. If so, you can adjust the script and change the default to whatever your comport has become, or use an environment variable. IIRC, you can add something like "set relayport=COM5" to your c:\autoexec.bat . It has been a long time since I worked with Windows. Please let me know if this works.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== Button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyACMx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a3feeb5b667a9b6a86b0a1c4f29198b8f91766c9
3574
3573
2015-11-11T11:15:36Z
Cartridge1987
2553
/* additional considerations */
wikitext
text/x-wiki
== Intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
You can buy the USB Relay in the [http://www.bitwizard.nl/shop/usb-boards/usb-relay BitWizard shop].
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound. This has not been converted to a BAT file for windows yet.
For Windows users, there is an INF file in the zipfile. Tell windows that this is the driver for your device, and it will use the builtin driver to create a virtual comport. The "usbr.bat" script assumes this has become "COM3", but it could be a higher number. If so, you can adjust the script and change the default to whatever your comport has become, or use an environment variable. IIRC, you can add something like "set relayport=COM5" to your c:\autoexec.bat . It has been a long time since I worked with Windows. Please let me know if this works.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== Button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyACMx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== Additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
3f69d715b5a6300c613b3d06015385b8dec2b07d
3575
3574
2015-11-11T11:15:48Z
Cartridge1987
2553
/* power consumption */
wikitext
text/x-wiki
== Intro ==
The USB relay board has two relays that can easily be controlled from a computer.
This allows your computer to switch the mains for other devices or signals or lower voltage DC power signals.
You can buy the USB Relay in the [http://www.bitwizard.nl/shop/usb-boards/usb-relay BitWizard shop].
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
In the zipfile at [[http://www.bitwizard.nl/software/usbrelay.zip]] you'll find usbr and usbr.bat that allow you to activate and deactivate relays from the commandline under Unix/Windows respectively.
For fun there is also the ticktock program that will excercise the relays causing a ticktock sound. This has not been converted to a BAT file for windows yet.
For Windows users, there is an INF file in the zipfile. Tell windows that this is the driver for your device, and it will use the builtin driver to create a virtual comport. The "usbr.bat" script assumes this has become "COM3", but it could be a higher number. If so, you can adjust the script and change the default to whatever your comport has become, or use an environment variable. IIRC, you can add something like "set relayport=COM5" to your c:\autoexec.bat . It has been a long time since I worked with Windows. Please let me know if this works.
=== Related projects ===
== Pinout ==
{| border=1
! pin !! function !! remark
|-
| 1 || NO 1 || Normally open contact for relay 1
|-
| 2 || C 1 || center connection for relay 1
|-
| 3 || NC 1 || normally closed contact for relay 1
|-
| 4 || NO 2 || Normally open contact for relay 2
|-
| 5 || C 2 || center connection for relay 2
|-
| 6 || NC 2 || normally closed contact for relay 2
|-
|}
=== LEDs ===
There is one power led.
On the board are two LEDs near each of the relays indicating the state of the relays.
== Jumper settings ==
There are no jumpers.
== Button ==
The button causes a reset. The CPU on the board will then reboot and start up in usb Bootloader mode. This is necessary for firmware upgrades. Not useful for normal situations.
== Protocol ==
The usbrelay will come up as a virtual serial port. (i.e. /dev/ttyACMx under Linux). Windwos users will get a new COM port.
To set an output bit and thus activate a relay, you send "set <relaynumber>\n" to the virtual serial port. i.e. send "set 0" to activate the first relay.
To clear an output bit send "clr <relaynumber>".
the relaynumbers 0 and 1 are the relays. There is one extra led that can be used for indication purposes that has number 2.
Some more commands are available. They are not very relevant for the usbrelay. Connect to the device using your favorite serial communications program and type "help".
== Additional considerations ==
Each relay draws about 70mA. Thus the module will draw about 150mA if both relays are active. Most computers will be able to supply this current, but the rasbperry pi might not. The Revision 1 raspberry pi has a polyfuse that prevents the board from drawing this much power. The Revision 2 Raspberry pi does not have the polyfuse, so it will work, provided your powersupply is powerful enough to provide current for the Pi + 150mA.
== Default operation ==
By default the relays will start out in the "off" position. (i.e. a connection between the common and the "normally closed" will be present).
== Power consumption ==
Each relay typically consumes about 55mA. Max 70mA.
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
defbd3f75a9f92963cd670539b8e229ea8ec9861
USB-multio
0
46
3576
3403
2015-11-11T11:16:52Z
Cartridge1987
2553
/* programming */
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
That can be bought in the [http://www.bitwizard.nl/shop/avr-boards/usb-multio-21 BitWizard shop].
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.<br>
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
For software development, implmenting USB communication we recommend LUFA:
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
d0f7e4ed4a6ecd68926eaed1cf82b8d535de46e4
Installing and booting FriendlyArm mini6410
0
1630
3577
2483
2015-11-11T11:18:56Z
Cartridge1987
2553
/* the basics */
wikitext
text/x-wiki
= The basics =
This section explains how the S3C6410 processor boots.
The processor has a boot rom, called "iROM" or "BL0" that is able to boot from two possible locations.
The iROM loads either the first 8k of NAND memory, or when told to boot SD, 8k of data from the SD card. The data loaded from the SD card is taken from "near the end" of the card. For the exact location see "Application Note (Internal ROM Booting) S3C6410X, july 24, 2008" from Samsung.
That 8k bootloader is sometimes called "BL1". It is loaded into a piece of SRAM inside the CPU. The code for this can be provided by "superboot".
This BL1 then initializes the SDRAM, and loads further bootloaders and/or the OS.
Superboot is able to read the first fat partition on the SD card, look into the /Images directory for a file called FriendlyARM.ini, and boot according to the instructions found therein.
Linux kernels are booted through a second stage bootloader called uboot. The binary (usually called uboot.bin) is usually stored in the Images directory or in a subdirectory thereof.
== FriendlyARM.ini ==
explain syntax here.
== Kernel ==
== Root filesystem ==
074ff3de3be98aabcdb69d7b706f7cc123523c21
Motor protocol
0
657
3578
2852
2015-11-13T09:26:48Z
Cartridge1987
2553
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the motor board will be explained on this page.
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The motor board will ignore any transactions on the bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= Write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The motor boards defines several ports.
{| border=1
! port !! function
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction X with intensity <byte>
|-
| 0x21 || Spin motor A in direction Y with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction X with intensity <byte>
|-
| 0x31 || Spin motor B in direction Y with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf0 || write 0xaa here to unlock the change address register.
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|-
| 0x58 || set PWM value for all four outputs as a single 32-bit value.
|}
= Read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| 0x20 || Read back intensity and direction of motor A
|-
| 0x21 || Read back intensity and direction of motor A
|-
| 0x30 || Read back intensity and direction of motor B
|-
| 0x31 || Read back intensity and direction of motor B
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|-
| 0x58 || get all 4 PWM values as a 32-bit value.
|}
= Examples =
== Read identification ==
read the identification string of the board. (motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
fd3bd94af083df05e6c41a1957fcf9928b1a05c4
DIO protocol
0
432
3579
3277
2015-11-13T09:29:00Z
Cartridge1987
2553
/* examples */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
ca6fd228394278e48a6c2f75561acaedcfe501a1
Blog 17
0
1825
3580
2015-11-16T10:22:06Z
Cartridge1987
2553
Created page with " == 2 Wheel controlled car == I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. == Stepper motor version == Hardware I used: == 'electric wh..."
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used:
== 'electric wheels' version ==
Hardware I used:
84e29686c1227d1c11569a84a49e2a9feb6b08a7
3581
3580
2015-11-16T11:10:57Z
Cartridge1987
2553
/* Stepper motor version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used:
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
== 'electric wheels' version ==
Hardware I used:
abd727653bc7738dc2188c4dc9db914b71b6a5b1
3582
3581
2015-11-16T11:11:25Z
Cartridge1987
2553
/* Stepper motor version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
== 'electric wheels' version ==
Hardware I used:
28e4dbffdd38d9f6310545cdec51ba49c7d8d6ab
3583
3582
2015-11-16T12:04:03Z
Cartridge1987
2553
/* 'electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
fi
if [ $BUTTON = "08" ]; then
#Car going left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:30:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:30:b
fi
if [ $BUTTON = "02" ]; then
#Car Stops
bw_tool -I -D /dev/i2c-1 -a 90 -W 22:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 32:80:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can bee found in [[Motor protocol]].
c5bffb5b2313c644b6ce0e73201447ada85019f5
3584
3583
2015-11-16T12:17:49Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop AGAIN
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
476c266bc82e1786e78434ef899ec8fc6f38c217
3585
3584
2015-11-16T12:18:19Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
a6b78567aa8fad765e8418149f61820089f07cb0
3586
3585
2015-11-16T13:01:35Z
Cartridge1987
2553
/* Stepper motor version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
a2e39d4658bd485b090ae5609176478cd1e9507e
3587
3586
2015-11-16T13:26:28Z
Cartridge1987
2553
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
306b518265c465582c2563641318e2aa6b48d874
3589
3587
2015-11-16T13:35:45Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
e9f613206ea16747f1c7a0b1edc470ded9c6aac0
3591
3589
2015-11-16T14:01:18Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The full car just went to be a carton box, with everything attached to it with tieraps.
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
66ca6143eca83caf0de1ca1cb9c79c46673d17ec
3592
3591
2015-11-16T14:15:01Z
Cartridge1987
2553
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
7a9614442c762ae68f0770b37a64b3578e2aac04
3593
3592
2015-11-16T14:34:26Z
Cartridge1987
2553
/* 3D printed wheels code */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
I also used some tieraps to attach the wheels on a board.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
4275abd0cb46f3d69d42512acac0aa47506ee79a
3594
3593
2015-11-16T15:12:43Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
For this I used to color cables to not get confused.
Pin 1 black
pin 2 red
pin 3 black
pin 4 red
pin 5
pin 6
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
246dd3135234dd220d22515333ae59348bcb3845
3595
3594
2015-11-16T15:41:56Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
For this I used to color cables to not get confused.
*Pin 1 black (Connected with right wheel down)
*pin 2 red (Connected with right wheel up)
*pin 3 black (Connected with left wheel down)
*pin 4 red (Connected with left wheel top)
*pin 5 Jumper Cable M-M (Connected with the ground from the battery)
*pin 6 Jumper Cable M-M (Connected with the power from the battery)
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
d73c5ccc3eea18bbdd220c126b4d5bf115a92665
3596
3595
2015-11-16T15:46:24Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
For this I used to color cables to not get confused.
*Pin 1 black (Connected with right wheel down)
*pin 2 red (Connected with right wheel up)
*pin 3 black (Connected with left wheel down)
*pin 4 red (Connected with left wheel top)
*pin 5 Jumper Cable M-M (Connected with the ground from the battery)
*pin 6 Jumper Cable M-M (Connected with the power from the battery)
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
4fc25a9746bbb463bb08b8c8ef62a7a11c12d074
3597
3596
2015-11-16T16:06:15Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable !!
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
dcb15d9e1cbae3041ec10d37c65180138190ba7a
3598
3597
2015-11-16T16:06:55Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
b6f2f6a9f154badc4c5d49571899d1d6c80e86ad
3599
3598
2015-11-17T10:28:55Z
Cartridge1987
2553
/* 2 Wheel controlled car */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
and connect with your raspberry pi:
ssh pi@192.168.234.218
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
73321228d5428eaf6de4625a3b012effd145d6ff
3600
3599
2015-11-17T10:30:06Z
Cartridge1987
2553
/* Connecting a USB WIFI Adapter on your Raspberry Pi */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
7a15e824790d71c6acea0f43f0f6e760675fb2d8
3601
3600
2015-11-17T10:49:21Z
Cartridge1987
2553
/* Connecting a USB WIFI Adapter on your Raspberry Pi */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
039606d466f5d182b70977d2a115e6f6260404b6
3603
3601
2015-11-17T11:43:25Z
Cartridge1987
2553
/* 3D printed wheels code */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
f7c6aacb9b229aec2d251911d9b1134bb5a9a9f5
3604
3603
2015-11-17T12:04:05Z
Cartridge1987
2553
/* 2 Wheel controlled car */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
54a9cf681dde23509b8b3cc128f46d3d1de93c5e
3606
3604
2015-11-17T12:47:04Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
Programming:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
657664e02322444164c29ee37db1db2be8a61548
3607
3606
2015-11-17T12:54:09Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programmed in:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
7567a7ebd41c13b4ea9d04e5ea08a86565c1ca57
3609
3607
2015-11-17T14:17:09Z
Cartridge1987
2553
/* Stepper motor version */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
[[File:StepperCar.jpg|400px|thumb|none|]]
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programmed in:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
db4033dc3a06ec1a0f4d5b5f6f47c99566b7513c
3610
3609
2015-11-17T14:55:29Z
Cartridge1987
2553
/* Code */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
[[File:StepperCar.jpg|400px|thumb|none|]]
///
The raspberry pi is connected with a battery so that it doesn't need a usb cable from the power plug to give it power.
The connection of the 7FETS is the same as in [[blog 16]]
blabla
///
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programmed in:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
d6fdfd1dd5699066a8028a61c4b28907ba10af9f
3611
3610
2015-11-18T10:34:04Z
Cartridge1987
2553
/* Code */
wikitext
text/x-wiki
== 2 Wheel controlled car ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
[[File:StepperCar.jpg|400px|thumb|none|]]
The raspberry pi is connected with a battery so that it doesn't need a usb cable from the power plug to give it power.
The connection of the 7FETS is the same as in [[blog 15]] and in [[blog 16]] you can read also read how to get the second 7FETs to work.
Cables blue till orange from the stepper motor go to pin 2,4,6 and as last 8. The power cable(red) from the stepper motor goes to pin 1.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programmed in:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
01ee88f7afbefaf1484ae5e32b5c249c72c97d74
Blog 16
0
1822
3588
3509
2015-11-16T13:29:13Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed in:
*Bash
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with a 7FETs Stepper motors [[Blog 15]]
*Making a 7FETs/Motor car [[Blog 17]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
c55178338b0257186cf5cb748585507d0453e687
File:OpenSCADRes.png
6
1826
3590
2015-11-16T13:56:34Z
Cartridge1987
2553
The result of the wheel I made in OpenSCAD.
Code can be found in [[Blog 17]]
wikitext
text/x-wiki
The result of the wheel I made in OpenSCAD.
Code can be found in [[Blog 17]]
9ead0892eeeb4f906fb7a6d741ac6c7e4b9255b8
File:3DPrintedWheel.jpg
6
1827
3602
2015-11-17T11:40:55Z
Cartridge1987
2553
The 3D printed wheel that was made for the 28BYJ-48 Stepper Motor.
Read how it is made in [[blog 17]]
wikitext
text/x-wiki
The 3D printed wheel that was made for the 28BYJ-48 Stepper Motor.
Read how it is made in [[blog 17]]
9c72cd0cb490db3b75af1bbbdc1248d3bcfa5e02
File:MotorWheelConnection.jpg
6
1828
3605
2015-11-17T12:43:52Z
Cartridge1987
2553
This image shows how the cables are connected with the I2C motor.
wikitext
text/x-wiki
This image shows how the cables are connected with the I2C motor.
60a76f6cc7eea3ec8d9db956eb609580b78ceb7a
File:StepperCar.jpg
6
1829
3608
2015-11-17T14:15:10Z
Cartridge1987
2553
The cables outside the box show which cable goes to which object for the 2 wheeled Stepper motor car. Made for [[blog 17]].
wikitext
text/x-wiki
The cables outside the box show which cable goes to which object for the 2 wheeled Stepper motor car. Made for [[blog 17]].
c765ed5ae14f7cba33f8377d6d78e429ed905287
Blog list
0
1798
3612
3477
2015-11-18T11:32:32Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
*[[Blog 01]] - Starting up the Raspberry Pi
*[[Blog 02]] - Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - Online weather station
*[[Blog 10]] - Pushbutton menu
*[[Blog 11]] - Turning off and on a lamp with crontab on special times
*[[Blog 12]] - Alarm Menu
*[[Blog 13]] - Scroll Menu
*[[Blog 14]] - BigRelay checker ( Raspberry Pi / Arduino )
*[[Blog 15]] - Basic stepper motor ( Raspberry Pi / Arduino )
*[[Blog 16]] - Working with two stepper motors.
*[[Blog 17]] - Making a 2 wheeled car ( Stepper Motor / electric wheel )
9c389775ffc8508984d0a007ca85a8964b5c77ef
Blog 18
0
1830
3613
2015-11-19T09:31:32Z
Cartridge1987
2553
Created page with " == Settings Menu == Hardware I used on my Raspberry Pi: *[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]]) Programmed in: *bash In th..."
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 1312314]]
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
=== Backlight/Contrast ===
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
=== Volume ===
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 10 20 30 40 50 60 70 80 90 100 )
# Element 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
b5979e596639b88f382f50cde4988be36166a668
3616
3613
2015-11-19T09:57:32Z
Cartridge1987
2553
/* Backlight/Contrast */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 1312314]]
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
=== Backlight/Contrast ===
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 10 20 30 40 50 60 70 80 90 100 )
# Element 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
5ee463e9c8179658a710b310fb7a4ee0367b9704
3617
3616
2015-11-19T09:58:12Z
Cartridge1987
2553
/* Settings Menu */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 1312314]]
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 10 20 30 40 50 60 70 80 90 100 )
# Element 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
2843ae47c46cc09cf03cafe0ed9db3ed6a5ec7b5
3618
3617
2015-11-19T09:58:33Z
Cartridge1987
2553
/* Backlight/Contrast */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 1312314]]
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 10 20 30 40 50 60 70 80 90 100 )
# Element 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
bd3823df6c2135fd7961642960c3edaf3d644a1f
3620
3618
2015-11-19T10:31:12Z
Cartridge1987
2553
/* Settings Menu */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because speed
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 10 20 30 40 50 60 70 80 90 100 )
# Element 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
fdc35b311335a3b2a679f5a9954019f3c4a0c566
3621
3620
2015-11-19T10:45:11Z
Cartridge1987
2553
/* Backlight/Contrast */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is actually the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals. I want to get 10 steps so people who use it could see it would got from zero to 100.
FF is in decimals 255. I just used an easy trick to get one of a tenth of 255. What is 25.5. What is around 19 in hexadecimals.
After that I kept counting 19 up the hexadecimal number, until I reach FF. Now it got better steps between the parts.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 10 20 30 40 50 60 70 80 90 100 )
# Element 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
2ac92363be166891bdf64d570584d7f29df5ad2c
3622
3621
2015-11-19T11:03:47Z
Cartridge1987
2553
/* Volume */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is actually the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals. I want to get 10 steps so people who use it could see it would got from zero to 100.
FF is in decimals 255. I just used an easy trick to get one of a tenth of 255. What is 25.5. What is around 19 in hexadecimals.
After that I kept counting 19 up the hexadecimal number, until I reach FF. Now it got better steps between the parts.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To program will at the end read a which % the audio is of it's maximum. With the grep and sed -e files it only search for the wanted text the full text normally would be without sed -e:
Mono: Playback -600 [91%] [-6.00dB] [on]
After the # I put and audio files, this is optional but there you could put a short audio file. So, that you can directly hear how the loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
5f721c78fc6a91a0e019634bc1eeeda938bc2151
3623
3622
2015-11-19T11:04:01Z
Cartridge1987
2553
/* Volume */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is actually the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals. I want to get 10 steps so people who use it could see it would got from zero to 100.
FF is in decimals 255. I just used an easy trick to get one of a tenth of 255. What is 25.5. What is around 19 in hexadecimals.
After that I kept counting 19 up the hexadecimal number, until I reach FF. Now it got better steps between the parts.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To program will at the end read a which % the audio is of it's maximum. With the grep and sed -e files it only search for the wanted text the full text normally would be without sed -e:
Mono: Playback -600 [91%] [-6.00dB] [on]
After the # I put and audio files, this is optional but there you could put a short audio file. So, that you can directly hear how the loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
c5d397e7ec61ce33b0357510814a16d535bd5005
3624
3623
2015-11-19T11:05:51Z
Cartridge1987
2553
/* Volume */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is actually the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals. I want to get 10 steps so people who use it could see it would got from zero to 100.
FF is in decimals 255. I just used an easy trick to get one of a tenth of 255. What is 25.5. What is around 19 in hexadecimals.
After that I kept counting 19 up the hexadecimal number, until I reach FF. Now it got better steps between the parts.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To program will at the end read a which % the audio is of it's maximum. With the grep and sed -e files it only search for the wanted text the full text normally would be without sed -e:
Mono: Playback -600 [91%] [-6.00dB] [on]
This has been also explained in [[blog 09]], if you want more explanation.
After the # I put and audio files, this is optional but there you could put a short audio file. So, that you can directly hear how the loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
30422105cd246fd107352284e9a1196492f3b975
3625
3624
2015-11-19T11:07:37Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is actually the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals. I want to get 10 steps so people who use it could see it would got from zero to 100.
FF is in decimals 255. I just used an easy trick to get one of a tenth of 255. What is 25.5. What is around 19 in hexadecimals.
After that I kept counting 19 up the hexadecimal number, until I reach FF. Now it got better steps between the parts.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To program will at the end read a which % the audio is of it's maximum. With the grep and sed -e files it only search for the wanted text the full text normally would be without sed -e:
Mono: Playback -600 [91%] [-6.00dB] [on]
This has been also explained in [[blog 09]], if you want more explanation.
After the # I put and audio files, this is optional but there you could put a short audio file. So, that you can directly hear how the loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
[[User Interface]]
[[Blog 09]]
[[Blog 13]]
cf3e058fe439b6d43b8fed42e0afafa90daacaa3
3626
3625
2015-11-19T11:07:49Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is actually the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals. I want to get 10 steps so people who use it could see it would got from zero to 100.
FF is in decimals 255. I just used an easy trick to get one of a tenth of 255. What is 25.5. What is around 19 in hexadecimals.
After that I kept counting 19 up the hexadecimal number, until I reach FF. Now it got better steps between the parts.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To program will at the end read a which % the audio is of it's maximum. With the grep and sed -e files it only search for the wanted text the full text normally would be without sed -e:
Mono: Playback -600 [91%] [-6.00dB] [on]
This has been also explained in [[blog 09]], if you want more explanation.
After the # I put and audio files, this is optional but there you could put a short audio file. So, that you can directly hear how the loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
*[[User Interface]]
*[[Blog 09]]
*[[Blog 13]]
1f975a084149395727c590bd56ff0c375dc09c53
3627
3626
2015-11-19T11:13:25Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
The menu you can scroll through with button 5(up) and 6(down). On the screen than will be visible which 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to edit.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is actually the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals. I want to get 10 steps so people who use it could see it would got from zero to 100.
FF is in decimals 255. I just used an easy trick to get one of a tenth of 255. What is 25.5. What is around 19 in hexadecimals.
After that I kept counting 19 up the hexadecimal number, until I reach FF. Now it got better steps between the parts.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To program will at the end read a which % the audio is of it's maximum. With the grep and sed -e files it only search for the wanted text the full text normally would be without sed -e:
Mono: Playback -600 [91%] [-6.00dB] [on]
This has been also explained in [[blog 09]], if you want more explanation.
After the # I put and audio files, this is optional but there you could put a short audio file. So, that you can directly hear how the loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
*[[User Interface]]
*[[Blog 09| Temperature Station]], this can give extra information of how to work with grep.
*[[Blog 13| Scroll Menu]], this can give more explanation about the scripting.
b90cb2fc0c6bc757121b62ec2a598d35baaeddf3
3628
3627
2015-11-19T12:05:45Z
Cartridge1987
2553
/* Settings Menu */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
You can scroll through the menu with button 5(up) and 6(down). On the screen there will be visible which of the 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to use.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is almost the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals, because protocol 13 and 12 work in hexadecimals. FF is in decimals 255. I just used an easy trick to get a tenth of 255. What is 25.5. What is around 19 in hexadecimals. After that I kept counting 19 up the hexadecimal number, until I reached FF. Now it got good steps between every time up and down.
I made the Narray (text that will get displayed), because it is easer for people to understand 0 till 100, than 00 till FF.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To script will at the end read at which volume percentage the audio is. With the grep and sed -e it will remove all the information outside the volume percentage. Normally without sed -e it would look like:
Mono: Playback -600 [91%] [-6.00dB] [on]
In [[blog 09]] there is a deeper explanation about grep and sed -e.
#mplayer ru.mp3
After every '#' I put an audio file, this is optional but there you could put a short audio file. So, that you can directly hear how loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
*[[User Interface]]
*[[Blog 09| Temperature Station]], this can give extra information of how to work with grep.
*[[Blog 13| Scroll Menu]], this can give more explanation about the scripting.
2813f4ba839108876e640c10e6e2f71a6df89038
File:BacklightHigh.jpg
6
1831
3614
2015-11-19T09:50:08Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:BacklightLow.jpg
6
1832
3615
2015-11-19T09:50:31Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Blog 13
0
1809
3619
3349
2015-11-19T10:21:14Z
Cartridge1987
2553
/* Scroll Menu */
wikitext
text/x-wiki
== Scroll Menu ==
In this post I am making a Scroll Menu, what is a menu where I can choose from a list of my previous and future menus to use.
This is pretty handy so that I don't have to type in a command line to go to an other menu. Everything can just be controlled with the buttons on the
Rp_ui_board([[User Interface]]).
The mission is to make it possible that the menu goes up and down and that I then can select between the 2 options displayed on the first and second line of the Rp_ui_board([[User Interface]]).
What every button does:
*1. Select option 1
*2. Select option 2
*3. Go to the begin of the menu
*4. Go to the End of the menu
*5. Scroll down in the menu
*6. Scroll up in the menu
For this script I used some techniques from the previous script [[blog 12]](AlarmMenu).
Don't forget to make an exit function in every script you make that you want to put in the array of menus!
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
An array is a list names that are put together and you can find with asking for it's number.
The number counting of arrays begins with 0 and ends until you stopped giving names.
For this I used 2 previous scripts(option 1([[blog 10]]) and 2([[blog 12]])) and give the other 10 random names. ( I only did that to show the scrolling works. )
[[File:ScrollMenuStart.jpg|300px|thumb|none|]]
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
This is the second script and I called it Narray. (Names Array. You can of course call it what ever you want )
This array I made to print this text out on the display. I also could just have used the previous array, but with the second array I can print better names on the display.
As you can see some of these names don't use quotation marks, I only did that to show that you only really need to put quotation marks if you want to print a text with a space in it.
The display is 16x2, so you can only use a maximum amount of 16 characters in every row.
[[File:ScrollMenuEnd.jpg|300px|thumb|none|]]
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
This part checks if button 1(20) or 2(10) is pressed. If one of the buttons is pressed it looks in the array with the given number and will than run that script.
So if button 1 is pressed and Number = 2 it will run Jaap.
And if button 2 is pressed and Numb2 = 3 it will run Tim.
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) #can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
In this part it counts up or down with which the button is pressed. With button 5 is counts down an with button 6 it counts up.
The program counts down and up with 2, thanks to that every time 2 new options gets showed on the display. In the array there are 12 menus, so I used %12 so that when counting up or down it will continue at the top or the beginning. ( So that you don't have to go all back to option 2-4 when you are at option 11-12. )
I also explained working with % in [[blog 12]]:
With % it divides the number before it with the number after it and will give as result the number that couldn't get shared through it.
So simple examples:
12%5 (12:5)=2 | 2 times 5 | 2*5=10 | 12-10 = 2
14%12 (14:12)=1 | 1 time 12 | 1*12=12 | 14-12 = 2
The numbers that are given as result for pressing the button, will then be send to the last part of the script.
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
Numb2 and Numb3 will read the numbers that later should be displayed. The given numbers will get a +1, because otherwise the menu will start with 0 instead of 1.
This is of course the same with the second line. That also has to be 1 more.
The given numbers will be printed at the beginning thanks to "$Numb2"at the first row and "$Numb2" at the second row.
After that it will print the names on the name Array.( Narray ) Thanks to Narray reading the numbers [$Number] and [$Numb2].
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
The script all together is:
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BDetect=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( pushmenu2 AlarmMenu Jaap Tim Martin Koos Willem Bas Luuk Richard Nick Alex)
# Element 0 1 2 3 4 5 6 7 8 9 10 11
Narray=( "Temp Menu" "Alarm Menu" Settings "Board menu" "Fries Menu" "Banana Menu" "vega burger" "wc menu" Bananaphone "2001:ABC" "ghost server" "My name is...")
# Element 0 1 2 3 4 5 6 7 8 9 10 11
if [ $BDetect != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BDetect = "20" ]; then
./${array[$Number]}
fi
if [ $BDetect = "10" ]; then
./${array[$Numb2]}
fi
if [ $BDetect = "08" ]; then
Number=0
fi
if [ $BDetect = "04" ]; then
Number=10
fi
if [ $BDetect = "02" ]; then
Number=$(((Number + 10) % 12 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BDetect = "01" ]; then
Number=$(((Number + 2) % 12 )) #can be changed to 1 if you want to get it up by 1 / I did 2 because I think that is more functional.
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:AlarmMenuStart.jpg|300px|thumb|none|This is the Alarm Menu that you can see if you activate it with button 2]]
eae8f18994f4ec4d70ecf283e610d62c85c2f725
Blog 18
0
1830
3630
3628
2015-11-19T12:09:50Z
Cartridge1987
2553
/* Volume */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed in:
*bash
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
You can scroll through the menu with button 5(up) and 6(down). On the screen there will be visible which of the 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to use.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is almost the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals, because protocol 13 and 12 work in hexadecimals. FF is in decimals 255. I just used an easy trick to get a tenth of 255. What is 25.5. What is around 19 in hexadecimals. After that I kept counting 19 up the hexadecimal number, until I reached FF. Now it got good steps between every time up and down.
I made the Narray (text that will get displayed), because it is easer for people to understand 0 till 100, than 00 till FF.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To script will at the end read at which volume percentage the audio is. With the grep and sed -e it will remove all the information outside the volume percentage. Normally without sed -e it would look like:
Mono: Playback -600 [91%] [-6.00dB] [on]
In [[blog 09]] there is a deeper explanation about grep and the sed -e.
#mplayer ru.mp3
After every '#' I put an audio file, this is optional but there you could put a short audio file. So, that you can directly hear how loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
*[[User Interface]]
*[[Blog 09| Temperature Station]], this can give extra information of how to work with grep.
*[[Blog 13| Scroll Menu]], this can give more explanation about the scripting.
65ece0086ae2e69bf4d182afdd15fe9f824754d1
3654
3630
2015-11-23T12:35:58Z
Cartridge1987
2553
/* Settings Menu */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed with:
*bash
*[[Bw tool]]
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
You can scroll through the menu with button 5(up) and 6(down). On the screen there will be visible which of the 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to use.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is almost the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals, because protocol 13 and 12 work in hexadecimals. FF is in decimals 255. I just used an easy trick to get a tenth of 255. What is 25.5. What is around 19 in hexadecimals. After that I kept counting 19 up the hexadecimal number, until I reached FF. Now it got good steps between every time up and down.
I made the Narray (text that will get displayed), because it is easer for people to understand 0 till 100, than 00 till FF.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To script will at the end read at which volume percentage the audio is. With the grep and sed -e it will remove all the information outside the volume percentage. Normally without sed -e it would look like:
Mono: Playback -600 [91%] [-6.00dB] [on]
In [[blog 09]] there is a deeper explanation about grep and the sed -e.
#mplayer ru.mp3
After every '#' I put an audio file, this is optional but there you could put a short audio file. So, that you can directly hear how loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
*[[User Interface]]
*[[Blog 09| Temperature Station]], this can give extra information of how to work with grep.
*[[Blog 13| Scroll Menu]], this can give more explanation about the scripting.
0965736bc8b7a4600a8fb72fbb12b5bc5c4f923b
Blog 16
0
1822
3631
3588
2015-11-19T13:35:42Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed in:
*Bash
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with a 7FETs Stepper motors [[Blog 15]]
*Making a 7FETs/Motor car [[Blog 17]]
0df05fccc8c425501b03476d117635dbcc5cd48f
3648
3631
2015-11-23T11:59:07Z
Cartridge1987
2553
/* Working with 2 7FETs Stepper motors */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed with:
*Bash
*[[BW Tool]]
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with a 7FETs Stepper motors [[Blog 15]]
*Making a 7FETs/Motor car [[Blog 17]]
cfeacf203321e3b28e77467df3cfd581155cb903
3649
3648
2015-11-23T11:59:24Z
Cartridge1987
2553
/* Working with 2 7FETs Stepper motors */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programmed with:
*Bash
*[[Bw tool]]
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with a 7FETs Stepper motors [[Blog 15]]
*Making a 7FETs/Motor car [[Blog 17]]
63e64dd6378f5f85d8d199deedb4d540d2e305fc
3652
3649
2015-11-23T12:04:19Z
Cartridge1987
2553
/* Working with 2 7FETs Stepper motors */
wikitext
text/x-wiki
== Working with 2 7FETs Stepper motors ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
*[[Bw tool]]
== Talking to the second 7FETs ( stepper motor ) ==
How to find the second 7FETs( on spi1 ). The other 7FETS also of course has 88 as address. ( On the 2 dots there has to be a hexadecimal number. )
But when you also send
bw_tool -s 50000 -a 88 -W 42:..:i
nothing will happen, only the other stepper motor will rotate.
The second spi (spi1) is named spidec0.1.
bw_tool -S -D /dev/spidev0.1
( If you are sending commands on I2C you have to use -I instead of -S (SPI) )
Result:
88: spi_7fets 1.1
To try it out:
bw_tool -S -D /dev/spidev0.1 -a 88 -W 42:0x200:i
This should make the stepper motor rotate 90 degrees.
== 2 7FETs rotating plateaus ==
Now I want to show how you can make it possible to let with the previous script let 2 7FETs rotate and stop a special amount of seconds.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
#$Address2 -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
What I did with the code from [[blog 15]] is: I added a second address that leads to the second 7FETs. I made is possible to also change the speed from the second stepper motor. You of course have to make them both as fast as each other otherwise one of them will keep spinning around. I also made it that they both run the command of rotating 90 degrees after the while do loop had ended.
== 2 7FETs stepper motors controlled by pushbuttons ==
Now lets control the 2 7FETs with the pushbuttons.
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
AddressI="bw_tool -I -D /dev/i2c-1 -a 94"
#SpeedX=0x25
#$Address -W 43:$SpeedX:b
#SpeedY=0x25
#$Address2 -W 43:$SpeedY:b
$AddressI -W 10:00:b
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
Rot=0x200
#Rot2=0x400
#Rot3=0x100
while true; do
Button=`$AddressI -R 30:b`
if [ $Button = "20" ]; then
$Address -W 42:$Rot:i
fi
if [ $Button = "10" ]; then
$Address -W 42:-$Rot:i
fi
if [ $Button = "08" ]; then
$Address -W 42:$Rot:i
$Address2 -W 42:$Rot:i
fi
if [ $Button = "04" ]; then
$Address -W 42:-$Rot:i
$Address2 -W 42:-$Rot:i
fi
if [ $Button = "02" ]; then
$Address2 -W 42:$Rot:i
fi
if [ $Button = "01" ]; then
$Address2 -W 42:-$Rot:i
fi
sleep 1
done
The most part of the script is just the same as the one explained at [[blog 15]]. The text:
$AddressI -W 11:00:b
$AddressI -t "1=1+ 2=1- 3=12+"
$AddressI -W 11:20:b
$AddressI -t "4=12- 5=2+ 6=2-"
I made to make clear for which button does what. So, button 1 makes it rotate it 0x200 ( 90 degrees ). And button 2 makes it rotate -0x200 ( 90 degrees the other way ). It should be that with -0x200 should be rotating to the right.
But if that isn't so you maybe have to change a cable. With 12+ and 12- I want to make clear that both button 1 and 2 are going the same way. ( I didn't know an other short way to do make clear that they are both rotating )
For now I just let the script rotate 90 degrees, but you can of course change the rot names in the command to make another button let the stepper motor rotate an other value)
Rot=0x200
#Rot2=0x400
#Rot3=0x100
[[File:27FETsStepperMotorsV.jpg|400px|thumb|none|]]
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with a 7FETs Stepper motors [[Blog 15]]
*Making a 7FETs/Motor car [[Blog 17]]
e1b262743026379bb8f811c5e7aa03f315c35eaa
Default addresses
0
484
3632
3322
2015-11-19T16:16:31Z
Cartridge1987
2553
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| [[LCD]] || 0x82
|-
| [[DIO]] || 0x84
|-
| [[Servo]] || 0x86
|-
| [[7FETs]] || 0x88
|-
| [[3FETs]] || 0x8A
|-
| [[temp|Temp]] (sometimes called SPI_LM35) || 0x8C
|-
| [[relay|Relay]] || 0x8E
|-
| [[Motor]] || 0x90
|-
| [[User Interface]] || 0x94
|-
| [[7_Segment]]|| 0x96
|-
<!--
| [[SPI_SPI]] || 0x98
|-
-->
| [[Pushbutton]] || 0x9A
|-
| [[Relay|Bigrelay]] || 0x9C
|-
| [[Dimmer]] || 0x9E
<!--
| Thermo || 0xa0
|-
| ... || 0xA2
|-
-->
|-
| [[Raspberry Juice]] || 0xA4
|-
| [http://www.bitwizard.nl/wiki/index.php/Relay rpi spi relay] || 0xA6
|}
5c0c8cfb2bb8d6574945c513128b83ca78fca3b4
3633
3632
2015-11-19T16:18:27Z
Cartridge1987
2553
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| [[LCD]] || 0x82
|-
| [[DIO]] || 0x84
|-
| [[Servo]] || 0x86
|-
| [[7FETs]] || 0x88
|-
| [[3FETs]] || 0x8A
|-
| [[temp|Temp]] (sometimes called SPI_LM35) || 0x8C
|-
| [[relay|Relay]] || 0x8E
|-
| [[Motor]] || 0x90
|-
| [[User Interface]] || 0x94
|-
| [[7_Segment]]|| 0x96
|-
<!--
| [[SPI_SPI]] || 0x98
|-
-->
| [[Pushbutton]] || 0x9A
|-
| [[Relay|Bigrelay]] || 0x9C
|-
| [[Dimmer]] || 0x9E
<!--
| Thermo || 0xa0
|-
| ... || 0xA2
|-
-->
|-
| [[Raspberry Juice]] || 0xA4
|-
| [Relay| RPI SPI Relay] || 0xA6
|}
7eb629da29baffa64e670ff046668cb1ed19506c
3634
3633
2015-11-19T16:18:40Z
Cartridge1987
2553
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| [[LCD]] || 0x82
|-
| [[DIO]] || 0x84
|-
| [[Servo]] || 0x86
|-
| [[7FETs]] || 0x88
|-
| [[3FETs]] || 0x8A
|-
| [[temp|Temp]] (sometimes called SPI_LM35) || 0x8C
|-
| [[relay|Relay]] || 0x8E
|-
| [[Motor]] || 0x90
|-
| [[User Interface]] || 0x94
|-
| [[7_Segment]]|| 0x96
|-
<!--
| [[SPI_SPI]] || 0x98
|-
-->
| [[Pushbutton]] || 0x9A
|-
| [[Relay|Bigrelay]] || 0x9C
|-
| [[Dimmer]] || 0x9E
<!--
| Thermo || 0xa0
|-
| ... || 0xA2
|-
-->
|-
| [[Raspberry Juice]] || 0xA4
|-
| [[Relay| RPI SPI Relay]] || 0xA6
|}
0df6df3fa91c9ecc16fa579d0dab664d4b4177ec
Blog 17
0
1825
3637
3611
2015-11-23T08:17:26Z
Cartridge1987
2553
/* 2 Wheel controlled car */
wikitext
text/x-wiki
== 2 Wheel controlled car: Raspberry Pi ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
[[File:StepperCar.jpg|400px|thumb|none|]]
The raspberry pi is connected with a battery so that it doesn't need a usb cable from the power plug to give it power.
The connection of the 7FETS is the same as in [[blog 15]] and in [[blog 16]] you can read also read how to get the second 7FETs to work.
Cables blue till orange from the stepper motor go to pin 2,4,6 and as last 8. The power cable(red) from the stepper motor goes to pin 1.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programmed in:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
ea9daf051345b390055ea0004c8d452d709e7404
3650
3637
2015-11-23T12:03:21Z
Cartridge1987
2553
/* Stepper motor version */
wikitext
text/x-wiki
== 2 Wheel controlled car: Raspberry Pi ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
*[[Bw tool]]
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
[[File:StepperCar.jpg|400px|thumb|none|]]
The raspberry pi is connected with a battery so that it doesn't need a usb cable from the power plug to give it power.
The connection of the 7FETS is the same as in [[blog 15]] and in [[blog 16]] you can read also read how to get the second 7FETs to work.
Cables blue till orange from the stepper motor go to pin 2,4,6 and as last 8. The power cable(red) from the stepper motor goes to pin 1.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programmed in:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
09dd4132254da2eafb7d5911a7b4ae4d3e19e68a
3651
3650
2015-11-23T12:04:03Z
Cartridge1987
2553
/* 'Electric wheels' version */
wikitext
text/x-wiki
== 2 Wheel controlled car: Raspberry Pi ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
*[[Bw tool]]
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
[[File:StepperCar.jpg|400px|thumb|none|]]
The raspberry pi is connected with a battery so that it doesn't need a usb cable from the power plug to give it power.
The connection of the 7FETS is the same as in [[blog 15]] and in [[blog 16]] you can read also read how to get the second 7FETs to work.
Cables blue till orange from the stepper motor go to pin 2,4,6 and as last 8. The power cable(red) from the stepper motor goes to pin 1.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
Programming:
*Bash
*[[Bw tool]]
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programmed in:
*Bash
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
72c563865d25af07ae47cb87c39094f712b22278
3653
3651
2015-11-23T12:05:00Z
Cartridge1987
2553
/* Programming */
wikitext
text/x-wiki
== 2 Wheel controlled car: Raspberry Pi ==
I made this on the Raspbery Pi for the stepper motor and for 'electric wheels'. This is just an example how to do it with 2 wheels but you can also of course easily change it to 4 wheels.
=== Connecting a USB WIFI Adapter on your Raspberry Pi ===
For both versions of the car it is needed that the raspbery pi can contact with the pc without a cable. Otherwise the car will the whole time be hanging on the cable.
For this we use a Dongle, for this I will make a quick and easy tutorial for how to get it to work:
First you get your dongle and just put it one raspberry pi USB port.
To look if your Raspberry Pi sees your dongle you have to give the command:
dmesg | more
When you gave the command you will get a big list when you scroll down with the space button you will something like this. That shows that the Raspberry Pi has seen the USB wifi adapter.
(You can leave the code with q or just keep scrolling down until the end.)
[ 3.023180] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 3.509915] usb 1-1.4: New USB device found, idVendor=148f, idProduct=76 01
[ 3.519408] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.287414] udevd[177]: starting version 175
To than change the network settings to let the dongle work. You have to change the network interface:
nano /etc/network/interfaces
In there you have to change the files into:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR WIFI NAME"
wpa-psk "YOUR WIFI PASSWORD"
The only thing you have to change is the caps locked text, where you have to obviously put in your wifi name and password.
After this you have to do:
sudo ifconfig
You then should find in the list one called wlan0.
wlan0 Link encap:Ethernet HWaddr e8:4e:06:2f:70:ca
inet addr:192.168.234.218 Bcast:192.168.234.0 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2800336 errors:0 dropped:0 overruns:0 frame:0
TX packets:26543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:399260993 (380.7 MiB) TX bytes:3389882 (3.2 MiB)
You than have to save/remember the name of the IP address, which you can read in the second row. Mine is:
inet addr:192.168.234.218
After that
reboot
And connect with your raspberry pi:
ssh pi@192.168.234.218
And now your raspberry pi should work with your dongle.
== Stepper motor version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*Two [http://www.bitwizard.nl/shop/expansion-boards/7fets 7FETs] | ([[7FETs]])
*Two [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*Two [http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*Two 28BYJ-48 Stepper Motor
Programming:
*Bash
*[[Bw tool]]
The full car just went to be a carton box, with everything attached to it with tieraps.
=== 3D printed wheels code ===
I made the wheels in [http://www.openscad.org/ OpenSCAD] and let them be printed out on a 3d printer.
The diameter of the wheel is 60mm and is 12mm high. The hole in the middle was made to put in the 28BYJ-48 Stepper Motor.
The OpenSCAD code:
$fs=0.2; $fa=2;
module stepperas(d=5, l=25, t=3)
{
difference()
{
cylinder (r=d/2 , h=l);
translate ([t/2, -5, -1]) cube([10, 20, l+2]);
translate ([-t/2-10, -5, -1]) cube([10, 20, l+2]);
}
}
difference()
{
union () {
difference () {
cylinder (r=60/2 ,h=12);
translate ([0, 0, 1.5])
cylinder (r=50/2, h=20);
}
cylinder (r=6,h=6);
}
translate ([0, 0, -1])
stepperas(5.2, 20, 3.2);
}
The result of the OpenSCAD code (Press F5 to see it in OpenSCAD):
[[File:OpenSCADRes.png|400px|thumb|none|]]
The Result in the real world:
[[File:3DPrintedWheel.jpg|400px|thumb|none|]]
=== Code ===
Here is a list of the commands one of each other, that you could send to the stepper motor.
#!/bin/bash
#Address=spi0 address2=spi1
Address="bw_tool -s 50000 -a 88"
Address2="bw_tool -S -D /dev/spidev0.1 -a 88"
#800 is rotating a full circle
Rot=800
Target=`$Address -R 41:i`
Speed1=0x200
Speed2=0x100
#Speed3=0x50
#Speed4=0xff
#Turn left
$Address -W 43:$Speed1:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Turn Right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Forwards
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:$Rot:i
sleep 10
#Go Backwards
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed2:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin right
$Address -W 43:$Speed2:b
$Address -W 42:$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:-$Rot:i
sleep 10
#Spin left
$Address -W 43:$Speed2:b
$Address -W 42:-$Rot:i
$Address2 -W 43:$Speed1:b
$Address2 -W 42:$Rot:i
[[File:StepperCar.jpg|400px|thumb|none|]]
The raspberry pi is connected with a battery so that it doesn't need a usb cable from the power plug to give it power.
The connection of the 7FETS is the same as in [[blog 15]] and in [[blog 16]] you can read also read how to get the second 7FETs to work.
Cables blue till orange from the stepper motor go to pin 2,4,6 and as last 8. The power cable(red) from the stepper motor goes to pin 1.
== 'Electric wheels' version ==
Hardware I used on my Raspberry Pi:
*One [http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*One [http://www.bitwizard.nl/shop/motor?search=motor Motor] | ([[Motor]])
*One [http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f Cable, 4 Pin (I2C), F-F ]
*Two single [http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-m Jumper cables M-M]
*Two electric wheels
*Soft cables ( To connect to the motor and the wheels )
*One dongle
Programming:
*Bash
*[[Bw tool]]
To put the wheels on the board:
I just made some holes and put some tieraps around the board to hold the electric wheels.
Cable connection:
{| border=1
! pin !! function !! cable
|-
| 1 || Output B1 || Black (Connected with right wheel down)
|-
| 2 || Output B2 || Red (Connected with right wheel up)
|-
| 3 || Output A1 || Black (Connected with left wheel down)
|-
| 4 || Output A2 || Red (Connected with left wheel top)
|-
| 5 || GND || White Jumper Cable M-M (Connected with the ground from the battery)
|-
| 6 || Vin || Red Jumper Cable M-M (Connected with the power from the battery)
|}
The cables and jumper cables can of course be different colors, but I told the color for the images.
The reason I used the jumper cable M-M is because it is easier to put in the battery.
[[File:MotorWheelConnection.jpg|400px|thumb|none|]]
( The cable on the bottom right is a 4 Pin (I2C) Cable, F-F. That is to connect the motor with the Raspberry Pi. )
=== Programming ===
Programming:
*Bash
*[[Bw tool]]
Script:
#!/bin/bash
#Wheel A left forward
#Wheel B Right forward
# X is forwards - Y is backwards
#Wheels at front
#20 A backwards
#21 A forwards
#22 A stop
#30 B backwards
#31 B forwards
#32 B stop
Address="bw_tool -I -D /dev/i2c-1 -a 90"
Speed="80"
Speed2="40"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON = "20" ]; then
#Car going forwards
$Address -W 21:$Speed:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "10" ]; then
#Car going backwards
$Address -W 20:$Speed:b
$Address -W 30:$Speed:b
if [ $BUTTON = "08" ]; then
#Car going left
$Address -W 21:$Speed2:b
$Address -W 31:$Speed:b
fi
if [ $BUTTON = "04" ]; then
#Car going right
$Address -W 21:$Speed:b
$Address -W 31:$Speed2:b
fi
if [ $BUTTON = "02" ]; then
#Car Stop
$Address -W 22:$Speed:b
$Address -W 32:$Speed:b
fi
if [ $BUTTON = "01" ]; then
exit
fi
sleep 1
done
Other movements:
#Spinning right
bw_tool -I -D /dev/i2c-1 -a 90 -W 20:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 31:80:b
#Spinning left
bw_tool -I -D /dev/i2c-1 -a 90 -W 21:80:b
bw_tool -I -D /dev/i2c-1 -a 90 -W 30:80:b
I think the code pretty much explains itself with the extra info I have given it. I used the push buttons as example of how it could be used.
All the protocols can been found in [[Motor protocol]].
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Blog list]] ( Overview of all my posts )
*[[Motor protocol]]
*[http://www.openscad.org/documentation.html OpenSCAD documentation]
895b4eec380cffb876476de2f55aa3b6148bf704
Blog 19
0
1836
3638
2015-11-23T08:31:54Z
Cartridge1987
2553
Created page with " == 2 Wheeled car: Arduino Version == #define Motor 0x48 #include <Wire.h> //Time to pause rotating //static unsigned long Pause = 10000; static unsigned long Spee..."
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
delayMicroseconds (10);
value = Wire.read();
delayMicroseconds (10);
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
delayMicroseconds (10);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
delayMicroseconds (10);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
*# X is forwards - Y is backwards
*#Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
5aaf2fa7452c56f86d2d7eaa9fa2030108fdc104
3639
3638
2015-11-23T08:32:07Z
Cartridge1987
2553
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
delayMicroseconds (10);
value = Wire.read();
delayMicroseconds (10);
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
delayMicroseconds (10);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
delayMicroseconds (10);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
3e4bb6dac5bd3f97f0eb467255d48bff57efb03c
3640
3639
2015-11-23T08:40:55Z
Cartridge1987
2553
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
delayMicroseconds (10);
value = Wire.read();
delayMicroseconds (10);
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
delayMicroseconds (10);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
delayMicroseconds (10);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
bc4b4d9307e811ff99e2d34e9991e9c3a7f18e10
3641
3640
2015-11-23T08:50:49Z
Cartridge1987
2553
/* 2 Wheeled car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
Wire.write(reg);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
97b8af7e19d64a075fb06ba43da98da1c070676a
3642
3641
2015-11-23T08:55:22Z
Cartridge1987
2553
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
Wire.write(reg);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
6c337477b0de752e01591dc111c3812b2529cc06
3643
3642
2015-11-23T09:21:51Z
Cartridge1987
2553
/* 2 Wheeled car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
17b7f8eb314d95f7e86a56c5036e757537dd80f7
3645
3643
2015-11-23T11:20:17Z
Cartridge1987
2553
/* 2 Wheeled car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
ff5d1a4bb4bf3229e213e31f694b52b6bb75943c
3646
3645
2015-11-23T11:20:52Z
Cartridge1987
2553
/* How to change SPI address, when the same addresses are connected on 1 port */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
5ec396c8e4a9d1758a6c09dd5db6de0c962b6d5e
3647
3646
2015-11-23T11:44:34Z
Cartridge1987
2553
/* How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
57c663a6029c8d433e454253243ec2804219dea9
3658
3647
2015-11-24T12:43:01Z
Cartridge1987
2553
/* How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
static unsigned char spi_7fet_addr = 0x88;
static unsigned char spi_7fet_addrL = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = -0x200;
static unsigned long Rot2 = -0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, Rot2);
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
} while (RCur != RF);
delay(Pause);
}
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
7ac080d701f256de8bcc761d35c83bb1ce6b29ab
3659
3658
2015-11-24T12:45:49Z
Cartridge1987
2553
/* 2 Wheeled 7FETs Car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
static unsigned char spi_7fet_addr = 0x88;
static unsigned char spi_7fet_addrL = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, Rot2);
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
} while (RCur != RF);
delay(Pause);
}
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
f44f051853efc6869c82dda0e16060a4eea2d044
3660
3659
2015-11-24T12:46:29Z
Cartridge1987
2553
/* 2 Wheeled 7FETs Car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
static unsigned char spi_7fet_addr = 0x88;
static unsigned char spi_7fet_addrL = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, Rot2);
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
} while (RCur != RF);
delay(Pause);
}
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
6597c36bafdb7f38eadd8b46a1e87ad02a3a9932
3661
3660
2015-11-24T13:15:57Z
Cartridge1987
2553
/* 2 Wheeled 7FETs Car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
static unsigned char spi_7fet_addr = 0x88;
static unsigned char spi_7fet_addrL = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, Rot2);
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
} while (RCur != RF);
delay(Pause);
}
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
241d91b067f33b15ac293c1ead95c7a6bd0a3d06
3662
3661
2015-11-24T16:29:48Z
Cartridge1987
2553
/* 2 Wheeled 7FETs Car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
c729ac785122b87bc336cd899fa75506ef7e3abe
3663
3662
2015-11-24T16:32:18Z
Cartridge1987
2553
/* 2 Wheeled 7FETs Car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
d90f606dfe405a43c3458f834d83d5438737dcdc
3672
3663
2015-11-25T12:29:49Z
Cartridge1987
2553
/* How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see in the [[default addresses]] it is 0x90.
That is because it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to the[http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
c683c742e7ba9976b5e4d7d1bad6aaa3002f52d6
3673
3672
2015-11-25T12:30:09Z
Cartridge1987
2553
/* I2C Scanner: Arduino */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see in the [[default addresses]] it is 0x90.
That is because it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
14984ff2ac525be0063ac5555814de2e2c7b63d8
3674
3673
2015-11-25T12:32:34Z
Cartridge1987
2553
/* I2C Scanner: Arduino */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached ot an other 7Fets connected to the raspberry Pi.
When you normally connect on SPI0 and scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
165b95d9cec4cef2a4689a0864f6796f19c1a9ba
3680
3674
2015-11-25T14:51:40Z
Cartridge1987
2553
/* How to change SPI address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
(If you use i2c you have to do:
i2cdetect -y 1
)
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
085411ec69a3e5733c46e94528bf082c69fea196
3681
3680
2015-11-25T14:52:40Z
Cartridge1987
2553
/* How to change address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
d609cb80991354bb74d722fba2d6abbad0ca2e36
Blog 03
0
1793
3644
3224
2015-11-23T10:22:50Z
Cartridge1987
2553
/* Change A: X to A: 94 */
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that rebooting didn't help for me getting to see A: 94. On my Display was the text visible:
I2C_rpi_ui 1.6
A: 1
[[File:94.png|300px|thumb|none|]]
On the image you can see how it normally has to look like.
If you have A:1 you have to write:
-a 1
instead of:
-a 94
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
When you do i2cdetect as above you will get the same result but than without the 4a visible:
sudo modprobe i2c-dev
sudo i2cdetect -y 1
but then without the 4a displayed on your screen.
You can change A: 1 to A: 94 with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
After this command: remove and connect the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
The above command is to reconnect the display.
Now it is fixed we can explore the things we can do with the Raspberry interface!
Go to [[Blog 04]], where I will make it possible to use the Raspberry interface as clock.
3d1ee6c1f4b9da1c3efa591dd3a53c7f93c4bfb8
Blog 15
0
1817
3655
3510
2015-11-24T10:31:34Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
decc11232aa312ef312fea95ddc26eb45f898d1e
3656
3655
2015-11-24T10:32:03Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[Dio protocol]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
e575000b847cdab3cd4acee35a98327947689387
3657
3656
2015-11-24T10:32:14Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[DIO protocol]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
132a4dd555ab4ae77f323fcb702c589b53c6a841
3665
3657
2015-11-25T09:13:55Z
Cartridge1987
2553
/* Stepper Motor Raspberry Pi */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
Programmed with:
*Bash
*[[Bw tool]]
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[DIO protocol]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
892a3c41e7b0175331383e3fb92893c25636e988
3666
3665
2015-11-25T09:18:10Z
Cartridge1987
2553
/* Working with stepper motor */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
Programmed with:
*Bash
*[[Bw tool]]
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
Programmed with:
*Arduino
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[DIO protocol]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
5857a4733056835a2b06978d566d82730ba686c0
3670
3666
2015-11-25T11:03:27Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
Programmed with:
*Bash
*[[Bw tool]]
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
Programmed with:
*Arduino
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
//set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
// set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[DIO protocol]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
45c46544ff399f99b5448ad64e35e6ecf8ae53d3
3671
3670
2015-11-25T11:04:45Z
Cartridge1987
2553
/* Rotating Plateau */
wikitext
text/x-wiki
== BETA ==
== Stepper Motor Raspberry Pi ==
In this part I am going to show my bash script for the raspberry pi version of rotating the stepper motor.
Hardware I used:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
*28BYJ-48 Stepper Motor
Programmed with:
*Bash
*[[Bw tool]]
I connected the RPi_UI board with the 7fets through a spi cable(on spi0). The stepper motor I connected with the 7fets through 5 male-female cables.
Cables blue till orange from the stepper motor I put on pin 2,4,6,8. ( 2 = blue 8 = orange ) The Red cable I putted on pin 3. It can also put on pin 1 or all the other dev power pins. ([[DIO protocol]]) You can see at the arduino set-up picture how I put them.
What my goal with the script was that the stepper motor should rotate with the value you gave it and stops for 10 seconds after that it has to start all over again.
The full script:
#!/bin/bash
Address="bw_tool -s 50000 -a 88"
Rot=-400
Target=`$Address -R 41:i`
#Speed=200
#$Address -W 43:$Speed:b`
Current=""
while true; do
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
done
sleep 10
done
Address="bw_tool -s 50000 -a 88"
Here I put the address of the script, where the script can reference multiple times to.
Rot=-400
With changing the number after rot you can change the amount of rotation. That the script has to do later. With 400 it turns 180 degrees.
And with minus it turns right without minus it turns right-ways.
Target=`$Address -R 41:i`
With target it will give the position it currently is in. This is for making it equal to the current.
#Speed=200
#$Address -W 43:$Speed:b`
This is something I added to the code. With this you can change the step delay. For now I gave it 200, what is equal to 20ms. So if you want it to turn faster you have to make the step delay less.
Current=""
This is to give current for now no worth. So that in the script it will directly start running the stepper motor.
$Address -W 42:$Rot:i
Target=`$Address -R 41:i`
Here I reference the rot and address commands and want it to rotate the amount of give in the rot part. And here again it asks for the target location with the second line.
while [ "$Current" != "$Target" ] ; do
sleep 0.2
Current=`$Address -R 40:i`
Here it looks if the current place of the rotating stepper motor is not equal to the target. If so it will re-look after 0.2 seconds what the current is.
And when it is equal it will sleep for 10 seconds and then start all over again:
done
sleep 10
done
[[File:Rasp7fetsStepper.jpg|400px|thumb|none|]]
== Working with stepper motor ==
In this post I am going to connect a stepper motor with my Arduino. I want the stepper motor to turn left and right, and I want the stepper motor to turn a certain degrees.
Before programming I first need to connect the Arduino with the stepper motor.
The hardware I used:
*[http://www.bitwizard.nl/shop/expansion-boards/7fets 7fets] | ([[7FETs]])
*28BYJ-48 Stepper Motor
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-15cm IDC cable 6 pin ]
( I also posted in [[Blog 14]], I connected the 7fets with an lcd + display. This is something what of course is not needed )
Programmed with:
*Arduino
[[File:7fetsStepper.jpg|400px|thumb|none|]]
As you can see in the image is that the stepper Motor has 5 coloured cables, that are all together in a white cube. These cables have to get connected with the 7fets. To do this you have to get 5 male to female cables. From cable blue to orange from the stepper motor it has to be connected to pin 2,4,6,8. The red cable can be put on pin 1, all the other places in the row that are dev power. ( Places where it can gets it's voltage )
( out 1 till 4 , works different counts 0 till 3)
( in 1 till 4 )
[[7FETs]]
Now the programming part:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], that I changed to get it working with the stepper motor.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_7fet_addr = 0x88;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
}
For activating the pins.
void loop(){
set_var32 (0x88, 0x42, 0x50);
delay(1000);
}
This says that at address 0x88 from the 7fets it has to go 50 further from the current position and after that it should take a 1 sec break. ( repeat and repeat itself) If you want to let the stepper motor to turn the other way you have to add a minues before 0x50. Example:
set_var32 (0x88, 0x42, -0x50);
0x42 is for setting the relative position. ( so in the example script it goes 50 further from the current position )
Port 42 is 32bits, don't forget about if a port is 32bits or not.
( On the [[DIO protocol]] you can find all the ports. )
== Rotating Plateau ==
Now I want to explain how you could rotate the stepper motor a certain degrees and in which direction. This can be handy if you want to use the stepper motor as plateau for a museum, or of course other projects were you need a stepper motor.
For this I will only paste the setup + loop. ( The other parts you can just copy paste from the previous code. I didn't want to make this page too long )
//beta
void loop(){
set_var32 (0x88, 0x42, 0x200);
delay(1000);
}
This script makes it possible that it turns 90 degrees with the register 0x200.
The values with the amount of rotation they make:
0x800 = 360 degrees
0x400 = 180 degrees
0x200 = 90 degrees
0x267 = 120 degrees
If you want another degree like for instance 45 you can just convert it.
Example
800:360 = 2.2222222 * 45 = 100
The final script to make it all work:
I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde] and used the set_var32 from previous script.
----
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
/*
unsigned char get_var (unsigned char addr, unsigned char a)
{
unsigned char v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = SPI (0x00);
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
*/
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long Tar;
unsigned long Cur;
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
//set_var32(0x88, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
}
void loop()
{
unsigned long v;
unsigned long Cur;
char buf[32];
set_var32(0x88, 0x42, Rot);
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
----
Explanation from the code:
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
This is for let later in the script be able to read the 32bit variables. ( That you normally do with -R on Raspberry Pi )
To make it let to read you have to count +1 on the addres. So if 0x88 is write 0x89 will than be read.
SPI (addr+1);
v is an unsigned long to make it 32 bits.
give value of 8bit, 16bit and 24bit.
<br>
unsigned char get_var is in not used but can be used if you want to change the step delay from the stepper motor
Here you can easily change the time for the delay rotating and change the amount the stepper motor has to rotate.
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% )
static unsigned long Rot = 0x200;
These 2 codes are taken out, because they are only needed if the difference between current and target is too big.
I had the problem while making this code that my target was counting up from an other value than that the value was.
//Makes the current(0x40) + target(0x41) zero. Handy if the current + target have a big difference.
//set_var32(0x88, 0x40, 0x00);
//set_var32(0x88, 0x41, 0x00);
Here you can change the step delay to make the stepper faster or slower.
//Change the step delay //50 is 4 times as fast as he normally goes (200)
//set_var(0x88, 0x43, 50);
Here it is getting the first Target and the current. ( You can directly see in the serial monitor if the values are right )
Tar = get_var32 (0x88, 0x41);
sprintf (buf, "FTarget: %08lx\r\n", Tar );
Serial.write (buf);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "Fcur: %08lx\r\n", Cur);
Serial.write (buf);
Here it writes to the stepper motor that it has to rotate 25%(0x200) forward.
char buf[32];
set_var32(0x88, 0x42, Rot);
After that it reads the new target.
v = get_var32 (0x88, 0x41);
sprintf (buf, "Target: %08lx\r\n", v);
Serial.write (buf);
In the do while it will look after every 0.2sec ( I didn't want a big list of spam ) what the the current position is. When the current and the target have the same value the do while ends and it will pause for 10 sec(Pause).
do {
delay(200);
Cur = get_var32 (0x88, 0x40);
sprintf (buf, "cur: %08lx\r\n", Cur);
Serial.write (buf);
} while (Cur != v);
delay(Pause);
}
== Useful links ==
*Working with the 7FETs BigRelay Board [[Blog 14]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*[[DIO protocol]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
01abdfb6921243bdda1a1fbd6eddb0a3af0ce257
Usb ws2812
0
1837
3664
2015-11-25T07:57:42Z
Rew
3
Created page with "[[File:usb_ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]] This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www..."
wikitext
text/x-wiki
[[File:usb_ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/usb_ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[[www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D0 || Data for led-chain 0.
|-
| GND || 3 || 4 || D0 || Data for led-chain 1.
|-
| GND || 5 || 6 || D0 || Data for led-chain 2.
|-
| GND || 7 || 8 || D0 || Data for led-chain 3.
|-
| GND || 9 || 10 || D0 || Data for led-chain 4.
|-
| GND || 11 || 12 || D0 || Data for led-chain 5.
|-
| GND || 13 || 14 || D0 || Data for led-chain 6.
|-
| GND || 15 || 16 || D0 || Data for led-chain 7.
|-
|}
Please ignore the other connectors on the board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years).
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
bc4ca98a58f26a1ddc270f022a97d83a7a803114
3675
3664
2015-11-25T13:21:56Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:usb_ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/usb_ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[[www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years).
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
4f21bef1e79b5718400090248da2cfd34448a956
3676
3675
2015-11-25T13:22:17Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:usb_ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/usb_ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years).
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
504b1bb0628204f0f02d0a0d25c00e97a8995059
3677
3676
2015-11-25T13:22:33Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:usb_ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/usb_ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years).
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
37d79d39f3381002604b1b2b3695cc565410221d
3678
3677
2015-11-25T13:48:25Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:usb_ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/usb_ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years).
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
da33f4b5a9d4623179c5e7507679d8080728f2d4
DIO protocol
0
432
3667
3579
2015-11-25T10:09:59Z
Cartridge1987
2553
/* Arduino example sketch: I2C */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a DIO_LEDS connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
36b63edb821de3b52538ba2773972d14c312da2b
3668
3667
2015-11-25T10:10:27Z
Cartridge1987
2553
/* Arduino example sketch: SPI */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "DIO_LEDS", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
dd234c39fdfa6a8e8c51a3ba063cc6c71216ff22
3669
3668
2015-11-25T10:45:27Z
Cartridge1987
2553
/* Example script for rpi */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x57 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
f565d53a1ebcb625cb45e3149a706e0c1e1aa46c
Blog list
0
1798
3679
3612
2015-11-25T14:15:49Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
[RP] = Raspberry Pi
[A] = Arduino
*[[Blog 01]] - [RP] Starting up the Raspberry Pi
*[[Blog 02]] - [RP] Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - [RP] !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - [RP] !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - [RP] !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - [RP] !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - [RP] !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - [RP] Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - [RP] Online weather station
*[[Blog 10]] - [RP] Pushbutton menu
*[[Blog 11]] - [RP] Turning off and on a lamp with crontab on special times
*[[Blog 12]] - [RP] Alarm Menu
*[[Blog 13]] - [RP] Scroll Menu
*[[Blog 14]] - [RP][A] BigRelay checker
*[[Blog 15]] - [RP][A] Basic stepper motor
*[[Blog 16]] - [RP] Working with two stepper motors.
*[[Blog 17]] - [RP] Making a 2 wheeled car ( Stepper Motor / electric wheel )
*[[Blog 18]] - [RP] Settings menu, where you can change the contrast, backlight and volume of your Raspberry pi.
*[[Blog 19]] - [A] Arduino double wheeled var versions ( Stepper motor / electric wheel )
567d9734c54391fc2ceaa9f294790fe485f1d72c
Blog 19
0
1836
3682
3681
2015-11-25T14:53:03Z
Cartridge1987
2553
/* How to change address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
64db8db59dc0b1dfa854590f9a79084674ff8470
3683
3682
2015-11-25T15:02:05Z
Cartridge1987
2553
/* I2C Scanner: Arduino */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
a13a956a3da1a131ced921f830e4536fe573afc3
3684
3683
2015-11-25T15:28:02Z
Cartridge1987
2553
/* How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
( At the bottom of [[Blog 03]] you can read how to change the address of an I2C Device )
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
b426145cc10e4852bd0bae08c480ceb762e656cb
3685
3684
2015-11-25T15:28:21Z
Cartridge1987
2553
/* How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
( At the bottom of [[Blog 03]] you can read how to change the address of an I2C Device )
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
e2d73c4b898964214deda08627af956c81bb8051
3686
3685
2015-11-25T15:32:11Z
Cartridge1987
2553
/* Other movements: */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
( At the bottom of [[Blog 03]] you can read how to change the address of an I2C Device )
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
== Useful links ==
[[Blog 03]], at the bottom it shows how to see and to change the I2C address
ffd7549bced4818cbeeb2567de15e26c8bccb65e
3687
3686
2015-11-25T15:32:22Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x21, Speed value doesn't matter);
set_var(0x48, 0x31, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
( At the bottom of [[Blog 03]] you can read how to change the address of an I2C Device )
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
== Useful links ==
*[[Blog 03]], at the bottom it shows how to see and to change the I2C address
bca3ca95d5dc8eb372ed3c379f2fe6db91bfd420
3688
3687
2015-11-26T13:02:34Z
Cartridge1987
2553
/* 2 Wheeled car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x22, Speed value doesn't matter);
set_var(0x48, 0x32, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
( At the bottom of [[Blog 03]] you can read how to change the address of an I2C Device )
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
== Useful links ==
*[[Blog 03]], at the bottom it shows how to see and to change the I2C address
4451b1aafe9d98527f0e1183aa9cf25618f217bc
3690
3688
2015-11-26T13:55:20Z
Cartridge1987
2553
/* 2 Wheeled 7FETs Car: Arduino Version */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x22, Speed value doesn't matter);
set_var(0x48, 0x32, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
( At the bottom of [[Blog 03]] you can read how to change the address of an I2C Device )
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards( You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
== Useful links ==
*[[Blog 03]], at the bottom it shows how to see and to change the I2C address
fdd557a7869c2dda61ccc026b26bd2d1321f98e1
3693
3690
2015-11-27T14:39:39Z
Cartridge1987
2553
/* Other movements: */
wikitext
text/x-wiki
== 2 Wheeled car: Arduino Version ==
#define Motor 0x48
#include <Wire.h>
//Time to pause rotating
//static unsigned long Pause = 10000;
static unsigned long Speed = 40;
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(Motor, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address); // transmit to motor
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission(); // stop transmitting
}
void loop()
{
unsigned long AddressA;
unsigned long AddressB;
char buf[32];
set_var(0x48, 0x21, Speed);
set_var(0x48, 0x31, Speed);
AddressA = get_var(0x48, 0x21);
sprintf (buf, "Speed: A:%d ", AddressA);
Serial.write (buf);
AddressB = get_var(0x48, 0x31);
sprintf (buf, " B: %d\r\n", AddressB);
Serial.write (buf);
delay(500);
// delay(Pause);
}
This is the list I have made for the Raspberry Pi Version, what also counts for the Arduino version(If your car is switched to the other side this can of course be the opposite):
* # X is forwards - Y is backwards
* #Wheels at front
* #20 A backwards
* #21 A forwards
* #22 A stop
* #30 B backwards
* #31 B forwards
* #32 B stop
You can also check the [[motor protocol]], for more info.
In my example script we go forward with 0x21 + 0x31 having the same value.
For other movements you should have(If you car is flipped this can of course be the opposite!):
To go backwards:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To go left:
set_var(0x48, 0x21, High Speed value);
set_var(0x48, 0x31, Low Speed value);
To go right:
set_var(0x48, 0x21, Low Speed value);
set_var(0x48, 0x31, High Speed value);
To stop the car:
set_var(0x48, 0x22, Speed value doesn't matter);
set_var(0x48, 0x32, Speed value doesn't matter);
To rotate to the left:
set_var(0x48, 0x21, Same Speed value);
set_var(0x48, 0x30, Same Speed value);
To rotate to the right:
set_var(0x48, 0x20, Same Speed value);
set_var(0x48, 0x31, Same Speed value);
If you do this don't forget to add:
static unsigned long Speed2 = "Put here your value";
== How to change the SPI address, when the same addresses are connected on 1 port (Raspberry Pi) ==
( At the bottom of [[Blog 03]] you can read how to change the address of an I2C Device )
Here I want to tell you quickly how to make it possible to connect an 7Fets attached to an other 7Fets connected to a raspberry Pi.
When you connect a device on SPI0 and and you scan:
bw_tool -S -D /dev/spidev0.0
You will see:
88: spi_7fets 1.1
This is something you don't want, because now he only sees 1 7FETs. And with the car you of course want to make it possible to let the car drive different directions.
To do this you first have to remove the 7FETs you got connected to the other 7FETs that is connected to the port.
Now you should change the address of the connected 7FETs. ( If you would have both of the 7FETs connected both the addresses will change to the new one )
To change the address you have to do the command:
bw_tool -S -D /dev/spidev0.0 -a 88 -w f1:55 f2:aa f0:70
( If you are using I2C, that works the same only you have to change -S to -I and /dev/spidev0.0 to /dev/spi-i2c-1 )
What the code does:
f1:55
opens the address
f2:aa
allows changing the address
f0:70
Is me changing the address to 70. ( You can of course give your own value )
On [[User Interface]] you can read more about the commands.
If you then connect the other 7FETs on the other 7FETs again and scan again you will get as result:
70: spi_7fets 1.1
88: spi_7fets 1.1
You can now easily talk to both 7FETs.
== I2C Scanner: Arduino ==
Here is a link to the I2C scanner code from Arduino playground:
*[http://playground.arduino.cc/Main/I2cScanner?action=sourceblock&num=1 I2C Scanner Code]
You don't need to change anything to the code.
When you run the code and you have for example the [[Motor]] attached you will get this as result in the serial monitor.
I2C SCANNER
Scanning...
I2C device found at address 0x48 !
done
You maybe be asking why it is 0x48, while you can see it in the [[default addresses]] as 0x90.
That is because on I2C it is getting divided by 2. So: 0x90/2=0x48. If you are getting confused it is 0x48 and not 0x45, because it is in hexadecimals.
I will also give link you to [http://playground.arduino.cc/Main/I2cScanner the arduino playground], if you want more information.
== 2 Wheeled 7FETs Car: Arduino Version ==
In this script I will show how to let 2 7FETs that are connected with a stepper motor drive forward.
If you scroll down you will also see how to go left, right and backwards.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
#define WAIT1 50
#define WAIT2 30
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
unsigned char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
void set_var32 (unsigned char addr, unsigned char a, unsigned long v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI (v>>8);
delayMicroseconds (WAIT2);
SPI (v>>16);
delayMicroseconds (WAIT2);
SPI (v>>24);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
unsigned long get_var32 (unsigned char addr, unsigned char a)
{
unsigned long v;
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr+1);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
v = (unsigned long)SPI (0x00);
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 8;
delayMicroseconds (WAIT2);
v |= (unsigned long)SPI (0x00) << 16;
delayMicroseconds (WAIT2);
v |= (unsigned long) SPI (0x00) << 24;
delayMicroseconds (WAIT2);
SPI_endpkt ();
return v;
}
// The given addresses to talk to.
static unsigned char spi_7fet_Raddr = 0x88;
static unsigned char spi_7fet_Laddr = 0x70;
//Time to pause rotating
static unsigned long Pause = 10000;
//Amount you want the stepper motor to rotate (0x200 = 25% 0x400 = 50% 0x800= 100% ) RotL means rotation of the left wheel.
static unsigned long Rot = 0x200;
static unsigned long RotL = 0x200;
void setup() {
//declare the motor pins as outputs
SPIinit ();
Serial.begin(9600);
char buf[32];
unsigned long RTar;
unsigned long RCur;
unsigned long LTar;
unsigned long LCur;
//Makes the current(0x40) + current(0x41) zero of both addresses. Handy if the current + target have a too big difference.
set_var32(0x88, 0x40, 0x00);
set_var32(0x88, 0x41, 0x00);
set_var32(0x70, 0x40, 0x00);
set_var32(0x70, 0x41, 0x00);
//Change the step delay //50 is 4 times as fast as he normally goes (200)
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
//Read current and read target from both the addresses
RTar = get_var32 (0x88, 0x41);
sprintf (buf, "RIGHT FTarget: %08lx\r\n", RTar );
Serial.write (buf);
RCur = get_var32 (0x88, 0x40);
sprintf (buf, "RIGHT Fcur: %08lx\r\n", RCur);
Serial.write (buf);
LTar = get_var32 (0x70, 0x41);
sprintf (buf, "LEFT FTarget: %08lx\r\n", LTar );
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, "LEFT Fcur: %08lx\r\n", LCur);
Serial.write (buf);
}
void loop()
{
unsigned long RF;
unsigned long RCur;
unsigned long LCur;
unsigned long LF;
char buf[32];
//sets rotation values of Rot & RotL
set_var32(0x88, 0x42, Rot);
set_var32(0x70, 0x42, RotL);
//Reads target of both the addresses
RF = get_var32 (0x88, 0x41);
sprintf (buf, " RTarget: %08lx", RF);
Serial.write (buf);
LF = get_var32 (0x70, 0x41);
sprintf (buf, " LTarget: %08lx\r\n", LF);
Serial.write (buf);
do {
delay(200);
//Reads current of both addresses
RCur = get_var32 (0x88, 0x40);
sprintf (buf, " Rcur: %08lx", RCur);
Serial.write (buf);
LCur = get_var32 (0x70, 0x40);
sprintf (buf, " Lcur: %08lx\r\n", LCur);
Serial.write (buf);
// looks if current is the same as the target from address 88 RF( Right forward wheel )
} while (RCur != RF);
delay(Pause);
}
All the information, of the code if have put after the two slashes(//). If you need some more information, you can check: [[Blog 15]], where I worked out working with one stepper motor.
===Other movements:===
Go backwards(You have to add a minus before the rotation value.(You can also add the minus in the loop before rot)):
outside void setup & loop:
static unsigned long Rot = -0x400;
static unsigned long Rot2 = -0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 200);
Going left:
outside void setup & loop:
static unsigned long Rot = 0x400;
static unsigned long Rot2 = 0x200;
in void setup:
set_var(0x88, 0x43, 100);
set_var(0x70, 0x43, 200);
Going Right:
outside void setup & loop:
static unsigned long Rot = 0x200;
static unsigned long Rot2 = 0x400;
in void setup:
set_var(0x88, 0x43, 200);
set_var(0x70, 0x43, 100);
== Useful links ==
*[[Blog 03]], at the bottom it shows how to see and to change the I2C address
264401b72b32d739c2555458c10a596b1bba27b8
Motor protocol
0
657
3689
3578
2015-11-26T13:14:11Z
Cartridge1987
2553
/* Write ports */
wikitext
text/x-wiki
'''--- UNDER CONSTRUCTION!!! ---'''
More info will be added.
= Introduction =
The protocol for the motor board will be explained on this page.
The addresses on the bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The motor board will ignore any transactions on the bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
= Write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The motor boards defines several ports.
{| border=1
! port !! function
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || write 0xaa here to unlock the change address register.
|-
! !! two separate brushed motors section....
|-
| 0x20 || Spin motor A in direction X with intensity <byte>
|-
| 0x21 || Spin motor A in direction Y with intensity <byte>
|-
| 0x22 || Stop motor A
|-
| 0x30 || Spin motor B in direction X with intensity <byte>
|-
| 0x31 || Spin motor B in direction Y with intensity <byte>
|-
| 0x32 || Stop motor B
|-
! !! Stepper motor section....
|-
| 0x10 || Set drive intensity for stepper mode (default is 0x20)
|-
| 0x40 || set current position. <4 bytes>
|-
| 0x41 || set target position. <4 bytes>
|-
| 0x42 || set relative position. <4 bytes>
|-
| 0x43 || set stepdelay. (in tenths of a millisecond, default 200: 20ms between steps).
|-
| 0x44 || Set number of driven coils. Writing 0x00 means driving one coil, other values mean driving two coils
|-
! !! Simple high-side PWM section....
|-
| 0x50 || set PWM value for output B1
|-
| 0x51 || set PWM value for output B2
|-
| 0x52 || set PWM value for output A1
|-
| 0x53 || set PWM value for output A2
|-
| 0x58 || set PWM value for all four outputs as a single 32-bit value.
|}
= Read ports =
The spi_motor boards defines the following read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
! !! two separate brushed motors section....
|-
| 0x20 || Read back intensity and direction of motor A
|-
| 0x21 || Read back intensity and direction of motor A
|-
| 0x30 || Read back intensity and direction of motor B
|-
| 0x31 || Read back intensity and direction of motor B
|-
! !! Stepper motor section....
|-
| 0x40 || read current position. <4 bytes>
|-
| 0x41 || read target position. <4 bytes>
|-
| 0x43 || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
! !! Simple high-side PWM section....
|-
| 0x50 || get PWM value for output B1
|-
| 0x51 || get PWM value for output B2
|-
| 0x52 || get PWM value for output A1
|-
| 0x53 || get PWM value for output A2
|-
| 0x58 || get all 4 PWM values as a 32-bit value.
|}
= Examples =
== Read identification ==
read the identification string of the board. (motor)
{| border=1
! data sent !! data recieved || explanation
|-
| 0x91 || xx || select destination with address 0x90 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Move stepper to step 0x12345678 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x90 || xx || select destination with address 0x90 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x78 || xx ||
|-
| 0x56 || xx ||
|-
| 0x34 || xx ||
|-
| 0x12 || xx ||
|}
7c9983741dcd7c16010d1d03fe4e01429ef808b0
Blog 20
0
1838
3691
2015-11-27T13:57:17Z
Cartridge1987
2553
Created page with "== Understanding the example code == Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]]. A link to the code: *[http://www.bitwi..."
wikitext
text/x-wiki
== Understanding the example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
==Useful links ==
*[[LCD]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
66c3106b184ce1d57deb267a405f97b9567cc223
3692
3691
2015-11-27T13:59:07Z
Cartridge1987
2553
/* Understanding the example code */
wikitext
text/x-wiki
== !BETA!Understanding the example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
==Useful links ==
*[[LCD]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
b30caa4196496addc1662dad0c19f0c6bb4628fe
3695
3692
2015-11-27T16:55:56Z
Cartridge1987
2553
/* !BETA!Understanding the example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select.
The _BV is the bit value.~
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR & the bit value from SPIF is 1, it will return the received SPDR value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0; // days ++;
}
}
}
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
==Useful links ==
*[[LCD]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
052879a3a715135bd69e8deca8b2970b0d61f17d
3696
3695
2015-11-27T16:56:16Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select.
The _BV is the bit value.~
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR & the bit value from SPIF is 1, it will return the received SPDR value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0; // days ++;
}
}
}
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
8ab80721acabe055b3241ebd5044a1153d919efc
3697
3696
2015-11-30T10:17:28Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
SPE - Enables the SPI when 1
MSTR - Sets the Arduino in master mode when 1, slave mode when 0
SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0; // days ++;
}
}
}
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
8115574744539e22b537bb201925b674504539f5
3698
3697
2015-11-30T10:52:09Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
SPE - Enables the SPI when 1
MSTR - Sets the Arduino in master mode when 1, slave mode when 0
SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0; // days ++;
}
}
}
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
4c16fec9c7571709dda4f093d99ab9e7f147abd8
3699
3698
2015-11-30T12:40:36Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
SPE - Enables the SPI when 1
MSTR - Sets the Arduino in master mode when 1, slave mode when 0
SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0; // days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
92c16c035ae4facbdecf2b2e20994010e3745de4
3700
3699
2015-11-30T13:15:39Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
SPE - Enables the SPI when 1
MSTR - Sets the Arduino in master mode when 1, slave mode when 0
SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
4c27d83d315e2a9552c9b0b03d8f7836f0115ad7
3703
3700
2015-11-30T13:40:45Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
SPE - Enables the SPI when 1
MSTR - Sets the Arduino in master mode when 1, slave mode when 0
SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
b4212623a6590202c55a013f7087c1b7e38ad992
3704
3703
2015-11-30T13:42:56Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
*SPE - Enables the SPI when 1
*MSTR - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
8bd12d6db5ef13bc8de1456f2683664ddd1f2096
3705
3704
2015-11-30T13:43:52Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
*SPE - Enables the SPI when 1
*MSTR - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
ecb7caabd0225fe4fa574b5ef7d1a7a8a066a8c7
3706
3705
2015-11-30T13:51:16Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
*SPE - Enables the SPI when 1
*MSTR - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
2b6497b78e86a19fa0c6ce3e463791700798f635
3709
3706
2015-11-30T14:11:58Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
*SPE - Enables the SPI when 1
*MSTR - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
/////
This is for talking to the servo and the 7FETs.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
18c750b54e366bbe6d06630b69a65c6a129ac41b
3716
3709
2015-11-30T16:10:16Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
Will tell to all the pins, that they should become outputs. It after that writings the value 1 (On) to Slave Select, to make a HIGH value to the digital pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR = SPI Control Register
The _BV is the bit value.~
*SPE - Enables the SPI when 1
*MSTR - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0 - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
897b047a2c453139a848b2b6df83dc6ca0b54cc4
3717
3716
2015-11-30T16:58:50Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in minutes, hours and days.
The const makes it that the 4 pins:
CLK = Shift Clock
MOSI = Master Out Slave Out
MISO = Master In Slave Out
SS = Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
The pinMode lines will make all the pins outputs. After that it writes the value 1(HIGH) to the Slave Select pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR(SPI Control Register)
The _BV is the bit value.~
*SPE(SPI Enable) - Enables the SPI when 1
*MSTR(Master mode) - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0(Speed per round) - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
ee236e991805e6790319e27b7d38f101ed990ae4
3718
3717
2015-12-01T09:25:30Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in seconds, minutes and hours. ( Also does days if you remove the comments(//).
The const makes it that the 4 pins:
SPICLK = SPI Shift Clock
SPIMOSI = SPI Master Out Slave Out
SPIMISO = SPI Master In Slave Out
SPISS = SPI Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
The pinMode lines will make all the pins outputs. After that it writes the value 1(HIGH) to the Slave Select pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR(SPI Control Register)
The _BV is the bit value.~
*SPE(SPI Enable) - Enables the SPI when 1
*MSTR(Master mode) - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0(Speed per round) - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
d00ce2d9dadd6e1cbecffabad77feea3ea774363
3719
3718
2015-12-01T09:31:30Z
Cartridge1987
2553
/* !BETA! Understanding the SPI example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation tips for the example I2C code you can see [[LCD]].
A link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff you are unfamiliar with on the internet.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts one up of the previous code. So, you can say it counts the seconds it is on.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Set up the contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in seconds, minutes and hours. ( Also does days if you remove the comments(//).
The const makes it that the 4 pins:
*SPICLK = SPI Shift Clock
*SPIMOSI = SPI Master Out Slave Out
*SPIMISO = SPI Master In Slave Out
*SPISS = SPI Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
The pinMode lines will make all the pins outputs. After that it writes the value 1(HIGH) to the Slave Select pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR(SPI Control Register)
The _BV is the bit value.~
*SPE(SPI Enable) - Enables the SPI when 1
*MSTR(Master mode) - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0(Speed per round) - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
99498f02bfd6a66ba80f2669c9b0b0c575051430
3720
3719
2015-12-01T12:50:36Z
Cartridge1987
2553
/* !BETA!Understanding the I2C example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation for the example I2C code you can see at the [[LCD]] page.
A direct link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff up you are unfamiliar with.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts how long the code is running.
It counts in seconds, minutes and hours.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Make contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right with one. Bit shifting in this example let a the bits go to the right. So easy example with a 4 bits: 0010 will become 0001.
The hexadecimal result should be: 0x41. This is an easy technique if you know the address value, but don't want to figure out what the hexadecimal value is when you divide it with 2.
(0x82>>1)
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in seconds, minutes and hours. ( Also does days if you remove the comments(//).
The const makes it that the 4 pins:
*SPICLK = SPI Shift Clock
*SPIMOSI = SPI Master Out Slave Out
*SPIMISO = SPI Master In Slave Out
*SPISS = SPI Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
The pinMode lines will make all the pins outputs. After that it writes the value 1(HIGH) to the Slave Select pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR(SPI Control Register)
The _BV is the bit value.~
*SPE(SPI Enable) - Enables the SPI when 1
*MSTR(Master mode) - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0(Speed per round) - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
c500deb0d09cbe9a6d4212bb499be2dbb327d3fc
3721
3720
2015-12-01T13:08:08Z
Cartridge1987
2553
/* !BETA!Understanding the I2C example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation for the example I2C code you can see at the [[LCD]] page.
A direct link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff up you are unfamiliar with.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts how long the code is running.
It counts in seconds, minutes and hours.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Make contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right by one. Bit shifting in this example let's all the bits go to the right. So what will happen:
0x82 (Hex) = 1000 0010
1000 010 >> 1 = 01000001 = 0x41 (Hex)
( As you can see all the 1's are going to the right )
In this example Using bit shifting is an easy technique, so that you don't have to calculate what the I2c address value is.
(cls = clear screen) This part can be called later in the script. The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
This will put characters in a string. He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will make contact to int x and int y. It will start transmitting to the address and talk to register 0x11.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in seconds, minutes and hours. ( Also does days if you remove the comments(//).
The const makes it that the 4 pins:
*SPICLK = SPI Shift Clock
*SPIMOSI = SPI Master Out Slave Out
*SPIMISO = SPI Master In Slave Out
*SPISS = SPI Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
The pinMode lines will make all the pins outputs. After that it writes the value 1(HIGH) to the Slave Select pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR(SPI Control Register)
The _BV is the bit value.~
*SPE(SPI Enable) - Enables the SPI when 1
*MSTR(Master mode) - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0(Speed per round) - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
c0841052b01e3cb8e1cb6e7b77145ecbd838fb90
3722
3721
2015-12-01T14:04:59Z
Cartridge1987
2553
/* !BETA!Understanding the I2C example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation for the example I2C code you can see at the [[LCD]] page.
A direct link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff up you are unfamiliar with.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts how long the code is running.
It counts in seconds, minutes and hours.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Make contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right by one. Bit shifting in this example let's all the bits go to the right. So what will happen:
0x82 (Hex) = 1000 0010
1000 010 >> 1 = 01000001 = 0x41 (Hex)
( As you can see all the 1 bits are going to the right )
In this example Using bit shifting is an easy technique, so that you don't have to calculate what the I2c address value is.
(cls = clear screen) The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
char *str, will make a pointer to str. For new people like me that can be confusing so it is recommended for now to see it as: 'char str[]'.
He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will put the print text on the wanted position on the display. It says the x and y position from the printed information.
It will start transmitting to the address and talk to register 0x11, which refreshes the page.
The bits value of y will be shifted 5 to the left. The '|' is an or function, what it does is that it wants one of or both of the two be 1.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it makes contact with the cls function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one more on the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in seconds, minutes and hours. ( Also does days if you remove the comments(//).
The const makes it that the 4 pins:
*SPICLK = SPI Shift Clock
*SPIMOSI = SPI Master Out Slave Out
*SPIMISO = SPI Master In Slave Out
*SPISS = SPI Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
The pinMode lines will make all the pins outputs. After that it writes the value 1(HIGH) to the Slave Select pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR(SPI Control Register)
The _BV is the bit value.~
*SPE(SPI Enable) - Enables the SPI when 1
*MSTR(Master mode) - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0(Speed per round) - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
fb807db03364821aa76a87600f81c74705844dab
3723
3722
2015-12-01T14:21:51Z
Cartridge1987
2553
/* !BETA!Understanding the I2C example code */
wikitext
text/x-wiki
== !BETA!Understanding the I2C example code ==
Hello, in this post I want to give explanation for the example I2C code you can see at the [[LCD]] page.
A direct link to the code:
*[http://www.bitwizard.nl/software/ar_i2c_lcd_demo.pde AR I2C LCD DEMO]
I would recommend if you are new to arduino to search stuff up you are unfamiliar with.<br>On [https://www.arduino.cc/en/Reference/HomePage Arduino's reference page] you can find a lot of the commands well explained.
What does the code?
The code is a counter, that counts how long the code is running.
It counts in seconds, minutes and hours.
The full code:
#include <Wire.h>
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
#define I2C_LCD_ADDR (0x82>>1)
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Open I2C Library:
#include <Wire.h>
Make contact with I2C Bus.
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
}
Gives the address location.
#define I2C_LCD_ADDR (0x82>>1)
The 0x82 is in this example bit shifted(>>) to the right by one. Bit shifting in this example let's all the bits go to the right. So what will happen:
0x82 (Hex) = 1000 0010
1000 010 >> 1 = 01000001 = 0x41 (Hex)
( As you can see all the 1 bits are going to the right )
In this example Using bit shifting is an easy technique, so that you don't have to calculate what the I2c address value is.
(cls = clear screen) The begin transmission write to the address given from I2C_LCD_ADDR with register 0x10 and the value 0. This will clear the screen of the lcd. After that is stops transmitting data.
void lcd_cls (void)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x10); // Send dummy byte to port 10: clear screen.
Wire.send (0);
Wire.endTransmission(); // stop transmitting
}
char *str, will make a pointer to str. For new people like me that can be confusing so it is recommended for now to see it as: 'char str[]'.
He again start transmitting to the address to register 0x0 and with the value given in the str.
void lcd_print (char *str)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x0); // Send dummy byte to port 10: clear screen.
Wire.send (str);
Wire.endTransmission(); // stop transmitting
}
This will put the print text on the wanted position on the display. It says the x and y position from the printed information.
It will start transmitting to the address and talk to register 0x11, where you can give the coordination.
The bits value of y will be shifted 5 to the left. The '|' is an or function, that switches to the other one with it's coordination.
After that it will stop transmitting.
void lcd_gotoxy (int x, int y)
{
Wire.beginTransmission(I2C_LCD_ADDR); // transmit to device #4
Wire.send (0x11); // Send dummy byte to port 10: clear screen.
Wire.send ((y << 5) | (x&0x1f));
Wire.endTransmission(); // stop transmitting
}
The loop will make it that the arduino, will repeatedly repeat the code. The character in the array will get the in the string the value of '0x10'.
The static make that x will only work with one function, and will stay with the same value. After that it runs the cls screen function.
void loop()
{
char buf[0x10];
static int x;
lcd_cls ();
Gives to lcd_gotoxy x & 0xf, and to the other one the value 1.
Gives to lcd_print to the str, with 0x10.
Gives to lcd_gotoxy the value 0,0 to clean it.
lcd_gotoxy (x&0xf,1);
lcd_print ("*");
lcd_gotoxy (0,0);
It will print on the serial monitor(CTRL+M) with the array given value and will counts with x++ one to the number.
Let's the lcd print the given value in buf(Group or arrays with bytes).
After that it waits 1000miliseconds = 1 seconds.
sprintf (buf, "x is: %d", x++);
lcd_print (buf);
delay(1000);
}
Mistake in the code is in the comments, that there is several times said that: // Send dummy byte to port 10: clear screen.
This only happens with the first one.
== !BETA! Understanding the SPI example code ==
Here I will give extra information, about the SPI example you can see at [[LCD]]:<br>
[http://www.bitwizard.nl/software/ardemo_lcd.pde Arduino lcd SPI demo]
I won't copy paste the full code, this time because I don't want to fill up the page.
While I only explaining special parts of the code.
What does this code do? This code makes will count how long the code is running and print it out on the display. It counts in seconds, minutes and hours. ( Also does days if you remove the comments(//).
The const makes it that the 4 pins:
*SPICLK = SPI Shift Clock
*SPIMOSI = SPI Master Out Slave Out
*SPIMISO = SPI Master In Slave Out
*SPISS = SPI Slave Select
will give a value that is read-only.
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
The pinMode lines will make all the pins outputs. After that it writes the value 1(HIGH) to the Slave Select pin.
([https://www.arduino.cc/en/Tutorial/SPIEEPROM More about SPCR])
SPCR(SPI Control Register)
The _BV is the bit value.~
*SPE(SPI Enable) - Enables the SPI when 1
*MSTR(Master mode) - Sets the Arduino in master mode when 1, slave mode when 0
*SPR1 and SPR0(Speed per round) - Sets the SPI speed, 00 is fastest (4MHz) 11 is slowest (250KHz)
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
character
~
When SPSR(SPI Status Register) & the bit value from SPIF(SPI Interrupt Flag) is 1, it will return the received SPDR(SPI Data Register) value.
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
When spi starts spkt it will write Slave select 0 and after that it will make it 1 again.
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
Name the address 0x82, that can't be changed.
static unsigned char addr = 0x82;
Makes WAIT1 be 25miliseconds, and WAIT2 be 15miliseconds.
#define WAIT1 25
#define WAIT2 15
Send to the lcd.
void send_lcd (unsigned char rnum, unsigned char len, char *s)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (rnum);
delayMicroseconds (WAIT2);
while (len--) {
SPI (*s++);
delayMicroseconds (WAIT2);
}
SPI_endpkt ();
}
Send to lcd
string length
void write_lcd (char *s)
{
send_lcd (0, strlen (s), s);
}
Unsigned char is an unsigned datatype, works the same as byte.
Value y gets bit shifted 5 steps to the left. ( More about bit shifting you can read above at the I2C part.)
void write_at_lcd (unsigned char x, unsigned char y, char *s)
{
char c;
c = (y << 5) | (x & 0x1f);
send_lcd (0x11, 1, &c);
write_lcd (s);
}
(cls = Clear Screen )
void cls_lcd (void)
{
char c;
send_lcd (0x10, 1, &c);
}
Direction to set_var, where address, register and value can be given. It has several waits, that direct to the times given before at #WAIT1 and #WAIT2.
void set_var (unsigned char addr, unsigned char a, unsigned char v)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (a);
delayMicroseconds (WAIT2);
SPI (v);
delayMicroseconds (WAIT2);
SPI_endpkt ();
}
Make clear what the addresses are from the servo and 7FETs.
static unsigned char spi_servo_addr = 0x86;
static unsigned char spi_7fet_addr = 0x88;
void set_servo_var (unsigned char a, unsigned char v)
{
set_var (spi_servo_addr, a, v);
}
void set_7fet_var (unsigned char a, unsigned char v)
{
set_var (spi_7fet_addr, a, v);
}
DDRC - The Port C Data Direction Register - read/write
PORTC - The Port C Data Register - read/write
PINC - The Port C Input Pins Register - read only
void setup (void)
{
int i;
SPIinit ();
Serial.begin (9600);
DDRC = 0x30;
PORTC = 0x20;
for (i=0;i<10;i++) {
PINC = 0x30;
delay (300);
}
cls_lcd ();
}
static long makes that the number can't be negative.
Millis = Returns the number of milliseconds since the Arduino board began running the current program.
So, if it is more than value next update 1000 milliseconds(1 second) it wil run the script.
In the script it will count at s ( seconds ) 1. (s+) If S is higher than 59 it will set s back to 0. And will count 1 at the (m)minutes section.
This works the same for the minutes section when it is geting above 59 it will count 1 to (h)hours.
void loop (void)
{
static long nextupdate = 1000;
static unsigned char h, m, s;
char buf[17];
if (millis () > nextupdate) {
nextupdate += 1000;
if (s < 59) s++;
else {
s = 0;
if (m < 59) m++;
else {
m = 0;
if (h < 23) h++;
else {
h = 0;
// days ++;
}
}
}
Here it will print out the given value from the if statement above. (%02d) And will print it out in 2 numbers on the display in decimals.
Gives the values to open writing to display. And puts with buf the information in it from the arrays.
sprintf (buf, "%02d:%02d:%02d", h, m, s);
write_at_lcd (8, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
// sprintf (buf, "%ld %ld", nextupdate, millis ());
// write_at_lcd (0, 0, buf);
// delay (100);
}
This is for talking to the servo and the 7FETs.
Register 0x20, with value s an reference 0xf gets bit shifted 4 times to the left.
{
static unsigned char olds;
if (olds != s) {
olds = s;
set_servo_var (0x20, (s & 0xf) << 4);
}
}
Makes a string, of four values. For values 1, 4, 2 and 8. Olds will than read what the latest values is that is given to s.
At 7FETs address the register 10 will set the given outputs at value to zero.
{
static unsigned char olds;
if (olds != s) {
static unsigned char values[4] = { 1, 4, 2, 8};
olds = s;
set_7fet_var (0x10, values [s & 0x3]);
}
}
}
== Useful links ==
*[[SPI versus I2C protocols]]
*[[General SPI protocol]]
*[[General I2C protocol]]
*[[Lcd protocol 1.6]]
*[[LCD]]
*[[7FETs]]
*[[Servo]]
*[[SPI connector pinout]]
*[https://www.arduino.cc/en/Reference/HomePage Arduino's reference page]
*[https://www.arduino.cc/en/Reference/PortManipulation Port Manipulation]
*[https://www.arduino.cc/en/Tutorial/SPIEEPROM SPI EEPROM]
21286ebe00e36de14d73d227737937bfa871b748
General I2C protocol
0
621
3694
1071
2015-11-27T16:00:47Z
Cartridge1987
2553
wikitext
text/x-wiki
BitWizard expansion boards communicate using an I2C protocol.
I2C is a standard protocol, sometimes called "TW" or "TWI" by other manufacturers.
Each I2C slave has its own I2C address. This allows us to daisy chain a large number of boards. The BitWizard I2C boards can be told to use a different I2C address so that you can resolve conflicts if you would otherwise have several devices at one address.
= Timing =
The slaves use an ATTINY44 processor. These have a hardware universal serial interface (USI) module that can be configured as "I2C slave". Many things however have to be processed in software. This means that some time is required between each byte. The hardware of the ATTINY44 will pull the SCL line low while the processing is not finished. If you use a software I2C master, doublecheck that your I2C master supports this feature.
The I2C protocol is specified at 100kHz and 400kHz bit rate. If you lower the pullup resistors a bit and have a short bus, the hardware will probably be able to handle bit rates up to 2MHz. This is not recommended. Use the standard 400kHz.
= Protocol =
To send a sequence of bytes to the slave I2C device, the master starts by creating a START condition: the SDA line goes low while SCL is held high. All slaves are now primed to receive an "address" byte. Next the master sends the address byte.
After this the protocol in theory depends on which slave you are talking to. In practice so far it is convenient to make the slaves talk a similar protocol: the next byte specifies a "register" or "port" address. After this you can send data to that port or register.
If the data can be considered a "data stream" like with the I2C_LCD board, you can call it a "port". If there is just a single value, it is more common to call it a register.
659fa61cf5c882311390a6367bb90288a452ff4c
Blog 03
0
1793
3701
3644
2015-11-30T13:35:25Z
Cartridge1987
2553
/* Change A: X to A: 94 */
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that rebooting didn't help for me getting to see A: 94. On my Display was the text visible:
I2C_rpi_ui 1.6
A: 1
[[File:94.png|300px|thumb|none|]]
On the image you can see how it normally has to look like.
If you have A:1 you have to write:
-a 1
instead of:
-a 94
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
When you do i2cdetect as above you will get the same result but than without the 4a visible:
sudo modprobe i2c-dev
sudo i2cdetect -y 1
but then without the 4a displayed on your screen.
You can change A: 1 to A: 94 with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
After this command: remove and connect the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
The above command is to reconnect the display.
Now it is fixed we can explore the things we can do with the Raspberry interface!
Note:
At I2c the values are in hexadecimals and get divided by two. That explains why 94 is 4A in i2cdetect.
If you want to change an address with an hexadecimal letter you can use capital and lower case letters.
Go to [[Blog 04]], where I will make it possible to use the Raspberry interface as clock.
82619f5be08d6b3fb242d3237e3396b3d631b0bd
3702
3701
2015-11-30T13:36:10Z
Cartridge1987
2553
/* Change A: X to A: 94 */
wikitext
text/x-wiki
Hello,
I wanted to make it possible to show the temperature + time on a Raspberry Display. Before that I am going to try other little things so that I can get some experience. What I am now going to make possible is that text that I write in the shell as code will be printed on display.
( So that I know how to print text on the display )
For getting it to work I first had to get the latest BitWizard tool.
git clone https://github.com/rewolff/bw_rpi_tools.git
After a reboot add i2c in the group
reboot
For adding user pi to group i2c:
sudo gpasswd -a pi i2c
To look if it is added:
groups
At my it gave the result:
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input
(Your list can of course be bigger or smaller. If it at least has the i2c everything is fine)
sudo -s
This code is for getting in the root, so that I don't have to type: sudo any more.
This is a handy command because many commands need sudo.
apt-get install i2c-tools
To install the i2c-tools you downloaded.
To make the raspberry in boot modes:
cd /boot
/boot/config.txt
nano config.txt
In the config.txt you have to remove the # from:
#dtparam=i2c_arm=on
( you have to scroll down to find it )
When you then reboot the raspberry he will directly use the code.
With the code he then knows he I connected to the i2c display.
(To reboot you just have to type: reboot as I said before)
To finally look when rebooted if he actually can see him:
sudo -s
i2cdetect
[[File:I2cdetecty.jpg|500px|thumb|none|]]
To check if it works. I will look if it show the location of the i2c.
modprobe i2c-dev
i2cdetect -y 1
Which should give as result:
[[File:I2cdetect.jpg|500px|thumb|none|]]
reboot if it doesn't appear this can happen if you didn't activate the right code.
If that doesn't help go to: "Change A: X to A: 94"
cd bw_rpi_tools/
cd bw_tool/
make
make install
cp bw_tool /usr/bin
These steps are for to install the bw_tool
( If you have a Raspberry pi 1, you have to replace /dev/i2c-1 with /dev/i2c-0 )
To write the text:
bw_tool -I -D /dev/i2c-1 -a 94 -t 'Hello'
bw_tool -I -D /dev/i2c-1 -a 94 -t ' Dave'
[[File:HelloDave.png|300px|thumb|none|]]
To remove all the printed text from the screen use the code:
bw_tool -I -D /dev/i2c-1 -a 94 -w 10:0
(for other commands go to the the wiki from the [http://www.bitwizard.nl/wiki/index.php/User_Interface user interface]:
Read example:
In write ports:
If you have 0x13 – set backlight ( b has to be after the code to say that it is in byte )
you should type:
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:90
To give a high backlight
bw_tool -I -D /dev/i2c-1 -a 94 -w 13:10
To get a really low backlight.
[[File:HelloDaveDark.png|300px|thumb|none|]]
So now I have printed my first text on the raspberry display.
Later I want to get with these the possibility to get a temperature visible.
== Change A: X to A: 94 ==
I once experienced that rebooting didn't help for me getting to see A: 94. On my Display was the text visible:
I2C_rpi_ui 1.6
A: 1
[[File:94.png|300px|thumb|none|]]
On the image you can see how it normally has to look like.
If you have A:1 you have to write:
-a 1
instead of:
-a 94
Example:
bw_tool -I -D /dev/i2c-1 -a 1 -t "Hello, Dave."
When you do i2cdetect as above you will get the same result but than without the 4a visible:
sudo modprobe i2c-dev
sudo i2cdetect -y 1
but then without the 4a displayed on your screen.
You can change A: 1 to A: 94 with these commands:
bw_tool -I -D /dev/i2c-1 -a 0 -w f1:55 F2:aa f0:94
After this command: remove and connect the display.
bw_tool -I -D /dev/i2c-1 -a 94 -W 14:0
The above command is to reconnect the display.
Now it is fixed we can explore the things we can do with the Raspberry interface!
Note:
At I2c the values are in hexadecimals and get divided by two. That explains why 94 is 4a in i2cdetect.
If you want to change an address with an hexadecimal letter you can use capital and lower case letters.
Go to [[Blog 04]], where I will make it possible to use the Raspberry interface as clock.
e6f4bcf63860cfa4b6f731937ae81e35275b5ef3
Servo 1.0 protocol
0
126
3707
2725
2015-11-30T14:09:11Z
Cartridge1987
2553
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || change address.
|}
(*) From version 1.1 and up.
= read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
64546e26a5716281d995bb160fa08a599a294820
3708
3707
2015-11-30T14:09:24Z
Cartridge1987
2553
/* read ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || change address.
|}
(*) From version 1.1 and up.
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
cdec1586a8186a80e6487a40acd947b2c8fc64fa
3710
3708
2015-11-30T14:22:12Z
Cartridge1987
2553
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
0e072caf17b63b7ccf4b84c082f505fbb0bcdab5
3711
3710
2015-11-30T14:22:30Z
Cartridge1987
2553
/* write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
596c7319d0b6027335fa7fa0b488edcc6a4c4f5b
Spi lcd 1.2 protocol
0
111
3712
438
2015-11-30T14:23:23Z
Cartridge1987
2553
wikitext
text/x-wiki
To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).
Bytes above 0xf0 are "special".
0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.
0xf1 is clear LCD.
0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.
0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.
0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.
0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.
Other bytes are reserved and are currently implemented as a no-op.
= Examples =
== Read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== Set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0xf0 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
7a13e87d2b0c38374c96b464fca41318e80de913
Spi lcd 1.3 protocol
0
112
3713
2561
2015-11-30T14:30:11Z
Cartridge1987
2553
/* write ports */
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line.
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
= read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= examples =
== read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1" (Up to 8 characters can be defined in CGRAM).
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
Getting back to display mode (DDRAM) and moving to home position (address 0) can also be done by sending: "82 01 80"
== Showing a cursor/blinking cursor ==
Show cursor position:
82 01 0E # cursor on
82 01 0C # cursor off
Blinking (current position):
82 01 0D #blink on
82 01 0C #blink off
== scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
9e039a34c1608ea9cda3959a1c1f6c1f14d8a019
3714
3713
2015-11-30T14:34:29Z
Cartridge1987
2553
wikitext
text/x-wiki
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]]
= Write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line.
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
= Read ports =
The spi_lcd board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|}
= Examples =
== Read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== Set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1" (Up to 8 characters can be defined in CGRAM).
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
Getting back to display mode (DDRAM) and moving to home position (address 0) can also be done by sending: "82 01 80"
== Showing a cursor/blinking cursor ==
Show cursor position:
82 01 0E # cursor on
82 01 0C # cursor off
Blinking (current position):
82 01 0D #blink on
82 01 0C #blink off
== Scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
c0ca5cf6daa5c6cb54d7859d1ebb97353926b592
Lcd protocol 1.6
0
1613
3715
2689
2015-11-30T14:46:44Z
Cartridge1987
2553
wikitext
text/x-wiki
This document describes the protocol specific to the LCD modules I2C_LCD, and SPI_LCD. Each can be configured with a 20x4 or a 16x2 display.
Addresses on the SPI and I2C bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
Each transaction on the bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address, similar to the i2c bus version.
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.
Also see the [[general SPI protocol]] and [[SPI versus I2C protocols]]
= Write ports =
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The spi_lcd board defines several ports.
{| border=1
! port !! function || implemented on
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || write up to 20 bytes for startupmessage line 1. || 1.6 and higher
|-
| 0x09 || write up to 20 bytes for startupmessage line 2. || 1.6 and higher
|-
| 0x0a || write up to 20 bytes for startupmessage line 3. || 1.6 and higher
|-
| 0x0b || write up to 20 bytes for startupmessage line 4. || 1.6 and higher
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.<br>Both are zero-based. The top line is line 0, the left character is char 0.
|-
| 0x12 || set contrast. Is written to EEPROM. (*)
|-
| 0x13 || set backlight. Temporary.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command.
|-
| 0x17 || set backlight, save to EEPROM. (*)
|-
| 0x20 || set the number of lines. Should not be necessary in most circumstances. (*)
|-
| 0x21 || set the number of characters per line. Should not be necessary in most circumstances. (*)
|-
| 0xf0 || change address. Requires a write to 0xf1 and 0xf2 first. (*)
|-
| 0xf1 || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || write 0xaa here to unlock the change address register.
|}
(*) These values are written to the eeprom. If you write "0xff", the value will be interpreted as "empty eeprom" on next boot, and the default will be used.
= Read ports =
The lcd boards support several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || current contrast value.
|-
| 0x13 || current backlight value.
|-
| 0x16 || number of bytes-in-buffer. The buffer is 32 bytes, This allows you to prevent sending a long string if it will overrun the buffer.
|-
| 0x17 || read the power-up-backlight-value (not the current).
|}
= Startup message =
The startup message is stored in eeprom. It will be shown in the future when you power up your display.
The space reserved for the messages is 20 characters per line. Writing each character to
eeprom takes some time. This means that after sending a line of data, it is best to wait 100ms before sending the next.
Because of the construction of the software inside the LCD, a termination marker is set just past the last byte sent. So if you send "ABC", the eeprom will contain: (shown in hex) 41 42 43 ff.
This means that for 20 characters 21 bytes are used. So if you need a full line, you will overwrite the start of the next line with the end marker.
So each time you provide a 20 character startup line, you will need to update the following line as well.
To clear the startup message send a single "0xff". For each line you care about. The current version will show the default message if the first character of the first line is 0xff. Later versions might decide on a per-line basis.
= Examples =
== Read identification ==
read the identification string of the board. ('spi_lcd 1.3').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x83 || xx || select destination with address 0x82 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== Set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x82 || xx || select destination with address 0x82 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Define custom character ==
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:
82 01 40 # set CGRAM char 0 line 0
82 00 01 02 04 08 10 10 10 # define character 0 (7 bytes)
82 11 00 # move to home position
82 00 41 42 0 # print characters A B and our newly defined character.
Use 0x48 instead of 0x40 to define character number "1".
the character data "01 02 04 08 10 10 10" is just an example. 11 11 11 1f 11 11 11 is the uppercase "H" that I have on my display right now.
the last two lines are just a example of how to get back to "display" mode. It works for me I don't have the inclination to find other ways.
== Scrolling the display ==
Send
82 01 18
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).
94998d8e8bb9795ca10f9d2fab08d38000978ab6
RGB clock
0
25
3724
3394
2015-12-02T10:03:46Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:RGB_clock_complete.jpg|thumb|300px|alt=The fully working clock|The fully working clock]]
This is the documentation page for the [http://www.bitwizard.nl/shop/rgb-clock-full-kit RGB clock kit].
[http://www.bitwizard.nl/shop/kits/rgb-clock Here] you can buy the components of the clock.
== Overview ==
Driver PCB for up to 64 common-anode RGB LEDs, or 192 normal LEDs.<br>
The PCB is designed for 1:3 multiplexing of the LEDs, and is equipped with 8 74HC595 shift registers (configured as 4 16-bit deep registers), 64 current-limiting resistors (220 Ohm by default) and 3 FETs to switch the cathode groups on-and-off.<br>
The PCB is equipped with a BitWizard-standard 20-pin IO connector, designed to work together with our USB-multio PCB, but it is also possible to connect our FTDI-ATmega, USB-bigmultio or Cyclone dev board, or one of your own boards, like for example an Arduino.<br>
<br>
SV1-SV8 are the connectors for the RGB LEDs. SV1-SV8 are connected to IC1-IC8.<br>
IC1 and IC5 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC1, and Qi-Qp are connected to IC5.<br>
IC2 and IC6 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC2, and Qi-Qp are connected to IC6.<br>
IC3 and IC7 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC3, and Qi-Qp are connected to IC7.<br>
IC4 and IC8 are configured as one 16-bit deep shift register. Qa-Qh are connected to IC4, and Qi-Qp are connected to IC8.<br>
The control pins (!OE, LATCH, !RESET, CLK) of all shift registers are connected in parallel.<br>
SER0 is connected to IC1.<br>
SER1 is connected to IC2.<br>
SER2 is connected to IC3.<br>
SER3 is connected to IC4.<br>
It is therefore required to update all shift registers at the same time.
== Assembly instructions ==
==== LED Driver PCB ====
* First, decide if you want to use 4 pushbutton switches (for the default firmware), 4 LEDs, or a mix (for custom firmware).
** SW1 and R65 or D7 and R71
** SW2 and R66 or D6 and R72
** SW3 and R67 or D5 and R73
** SW4 and R68 or D4 and R74
* Mount all necessary SMD components. Which component should go where, can be found in the table below.
* cut the header strips to the right length. Our suggestion:
** cut the first strip in one 10-pin long strip, and 5 6-pin long strips.
** cut the second header in 3 6-pin strips, and one 4-pin strip.
* solder all headers in place
* solder the desired switches in place
Component Value
IC1-IC8 74HC595
R1-R64 220R
R65-R68 10K
R69-R74 1K
C1-C8 100nF
C9 10uF
T1-T3 N-channel FET
D1 Double Diode (BAT54S for example)
D2-D7 LED
SW1-SW4 Pushbutton
[[File:RGB_clock_top.jpg|none|thumb|300px|alt=A closeup of the assembled board|A closeup of the assembled board]]
==== LED chains ====
===== Building your own clock-face =====
If you are not buying the laser-cut clock-face that we offer, you'll be building one yourself. A consideration is that at about 20cm radius, the legs of the LEDs are long enough to form the R, G and B common lines. If you make the clock larger, you'll have to run three wires along the leds....
The "puzzle" line between the four segments stems from the fact that the laser-cutter that we have access to only goes so big. And it comes in handy for transport. The laser-cutter could handle up to 30cm outer diameter. And it could handle half a clock at once. But the 4-fold symmetry looks nice.
The laser cutter leaves a bit of brown residue near the laser-cut edges. You can sand this off with a fine sandpaper.
===== Connecting the LEDs =====
Counting clockwise, starting at the LED to the right of the topmost LED:
Output Pin# Connector
Qp 8 SV6
Qo 7 SV6
Qn 6 SV6
Qm 5 SV6
Ql 4 SV6
Qk 3 SV6
Qj 2 SV6
Qi 1 SV6
Qg 7 SV2
Qf 6 SV2
Qe 5 SV2
Qd 4 SV2
Qc 3 SV2
Qb 2 SV2
Qa 1 SV2
[[File:RGB_clock_back_complete_edit.jpg|none|thumb|300px|alt=The full clock with a few locations marked]]
[[File:RGB_clock_quadrant.jpg|none|thumb|300px|alt=A fully assembled quadrant|A fully assembled quadrant]]
All R, G and B pins should be connected in parallel.<br>
[[File:RGB_LED_closeup.jpg|none|thumb|300px|alt=A closeup of one of the LEDs|A closeup of one of the LEDs]]
This is the same for each quadrant, only the connector numbers differ.
==== Putting it all together ====
Version 1.0 uses 12pin headers to connect to the LEDs, but unfortunately, 12-pin ICD connectors don't exist, so we used 14-pin ICD connectors.<br>
Pay close attention then connecting the 14-pin connectors to the PCB! Pin 1 through 12 should line up, and pin 13 and 14 should be "floating".
[[File:RGB_clock_connectors.jpg|none|thumb|300px|alt=Everything wired-up|Everything wired-up]]
As can be seen in this image, the left ICD connectors are a bit further towards the USB connector, and the right ICD connectors are a bit further to the switches. Also, the reset switch isn't mounted. We decided we would never use it, so left it out. Your version will come equipped with a reset switch<br>
<br>
After hooking everything up, you should end up with something like this:
[[File:RGB_clock_back_complete.jpg|none|thumb|300px|alt=The completed clock|The completed clock]]
== External resources ==
=== Datasheets ===
* [http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf 74HC595 datasheet]
=== Related projects ===
== Pinout ==
SV10 is connected as follows
<table border=1>
<tr><th> connector pin number</th><th>pin name</th><th>multiio AVR pin name</th></tr>
<tr><td> 1</td><td>GND </td> <td> </td> </tr>
<tr><td> 2</td><td>GND </td> <td> </td> </tr>
<tr><td> 3</td><td>SER0 </td> <td> PD1 </td> </tr>
<tr><td> 4</td><td>SER1 </td> <td> PD2 </td> </tr>
<tr><td> 5</td><td>SER2 </td> <td> PD3 </td> </tr>
<tr><td> 6</td><td>SER3 </td> <td> PD4 </td> </tr>
<tr><td> 7</td><td>!OE </td> <td> PD5 </td> </tr>
<tr><td> 8</td><td>LATCH </td> <td> PD6 </td> </tr>
<tr><td> 9</td><td>!RESET</td> <td> PB1 </td> </tr>
<tr><td>10</td><td>CLOCK </td> <td> PB0 </td> </tr>
<tr><td>11</td><td>R </td> <td> PB3 </td> </tr>
<tr><td>12</td><td>G </td> <td> PB2 </td> </tr>
<tr><td>13</td><td>B </td> <td> PB5 </td> </tr>
<tr><td>14</td><td>external clock source</td><td>PB4</td></tr>
<tr><td>15</td><td>IO1 </td> <td> PB7 </td> </tr>
<tr><td>16</td><td>IO0 </td> <td> PB6 </td> </tr>
<tr><td>17</td><td>IO3 </td> <td> PC6 </td> </tr>
<tr><td>18</td><td>IO2 </td> <td> PC7 </td> </tr>
<tr><td>19</td><td>VCC </td> <td> </td> </tr>
<tr><td>20</td><td>VCC </td> <td> </td> </tr>
</table>
<br>
SV1 through SV8 are connected as follows:
<table border=1>
<tr><td> 1</td><td>A0</td></tr>
<tr><td> 2</td><td>A1</td></tr>
<tr><td> 3</td><td>A2</td></tr>
<tr><td> 4</td><td>A3</td></tr>
<tr><td> 5</td><td>A4</td></tr>
<tr><td> 6</td><td>A5</td></tr>
<tr><td> 7</td><td>A6</td></tr>
<tr><td> 8</td><td>A7</td></tr>
<tr><td> 9</td><td>R</td></tr>
<tr><td>10</td><td>G</td></tr>
<tr><td>11</td><td>B</td></tr>
<tr><td>12</td><td>GND</td></tr>
</table>
<br>
SV9 can be used to connect an external clock source, or a servo motor, or...
<table border=1>
<tr><td> 1</td><td>GND</td></tr>
<tr><td> 2</td><td>VCC</td></tr>
<tr><td> 3</td><td>connected to pin14 of SV10</td></tr>
</table>
Pin 3 has two clamping diodes attached, to limit the voltage range to GND-0.6V and VCC+0.6V.<br>
We are considering connecting this pin through a very large valued resistor directly to the mains. In that case the clamping diodes are neccessary. The better option would be to use an optocoupler or something like that....
<br>
=== LEDs: ===
* D2 is connected to VCC from SV10
* D3 is connected to USB power
* D4 is connected to pin17 from SV10
* D5 is connected to pin18 from SV10
* D6 is connected to pin15 from SV10
* D7 is connected to pin16 from SV10
=== Switches: ===
* Switch1 (next to R71) is connected to pin16 from SV10
* Switch2 (next to R72) is connected to pin15 from SV10
* Switch3 (next to R73) is connected to pin18 from SV10
* Switch4 (next to R74) is connected to pin17 from SV10
== Jumper settings ==
JP1: Power supply selection.<br>
Open: LED driver board and microcontroller board have individual power supplies<br>
Closed: VCC from LED driver board and microcontroller board are connected.<br>
== Programming ==
Please refer to http://www.bitwizard.nl/wiki/index.php/Usbio#programming for information on programming the controller PCB.
== The software ==
The software supplied by BitWizard, is designed to run on the BitWizard USB-Multio board, but it should be possible to port it to other boards.<br>
A zipfile containing the latest source code can be downloaded here: http://www.bitwizard.nl/software/rgb_clock/
=== Default operation ===
==== Test modes ====
As of software version 20120208, there are several (test) modes included.
These can be accessed in two ways:
===== Over USB =====
All modes are available.
Usage:
m [m]
For example:
m 3
jumps to the LED test mode.
====== Mode 0 (default)======
Default operation.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
====== Mode 1 ======
Allows you to, for example, send your own RGB bitmaps to the clock with the "D", "E", and "F" commands.<br>
PWM routine: Enabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 2 ======
Enables you to manually turn colors on and off, and also send your own bitmaps.<br>
PWM routine: Disabled.<br>
Bitmap generation: Disabled.<br>
====== Mode 3 ======
Perfect for testing your LEDs and soldering work. This mode automatically generates a test sequence.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled, but using a test bitmap.<br>
====== Mode 4 ======
Normal clock operation, but with a twist: Instead of only lighting LED x from color y, LED 0 though x are all lighted.<br>
PWM routine: Enabled.<br>
Bitmap generation: Enabled.<br>
===== Using the pushbuttons =====
Only [[RGB_clock#Mode_0_.28default.29|mode 0]] and [[RGB_clock#Mode_4|mode 4]] are available.
Press Swtich 1 to toggle between both modes.
==== Loading custom bitmaps ====
This is only possible is some test modes.
===== Identical for each quadrant =====
Use the "d" command (only works in mode 2):
d [value]
The value should be in hex. However, it might be easyer to think binary. Each bit represents an LED.<br>
For example, to light each even LED:
d aaaa
Or for each odd LED:
d 5555
Only one color is active in this mode. To change the active color, use the "r", "g", and "b" commands.
To turn on the red LEDs, and turn off the green and blue LEDs:
r
The same goes for the "g" and "b" commands, only the colors differ.<br>
<br>
If you send the data quick enough (for example, with a script), it should be possible to generate some nice effects.
===== Complete RGB bitmap =====
Use the "D", "E", and "F" commands (only works in mode 1):<br>
This is a little bit more complicated than the previous option, but gives you a lot more possibilities.<br>
The "D" command controls the red LEDs.<br>
The "E" command controls the green LEDs.<br>
The "F" command controls the blue LEDs.<br>
To turn all red LEDs on, and all green and blue LEDs off:
D ff ff ff ff ff ff ff ff
E 00 00 00 00 00 00 00 00
F 00 00 00 00 00 00 00 00
Each nibble represents one LED in each quadrant. Let's call the quadrants 1, 2, 4, and 8. Quadrant 1 is the bottom right, quadrant 2 top right, quadrant 4 top left, and quadrant 8 bottom left.<br>
We only have 15 LEDs, so one of the 16 nibbles is not used:
D ff ff ff ff xf ff ff ff
^
Nibble x (also marked with a ^) is not in use.<br>
<br>
Table of which nibble represents which LED:
D ff|ff ff ff ff ff ff ff
x | | | | | | | LED 0
x| | | | | | | LED 1
|x | | | | | | LED 2
| x| | | | | | LED 3
| |x | | | | | LED 4
| | x| | | | | LED 5
| | |x | | | | LED 6
| | | x| | | | LED 7
| | | | x| | | LED 8
| | | | |x | | LED 9
| | | | | x| | LED 10
| | | | | |x | LED 11
| | | | | | x| LED 12
| | | | | | |x LED 13
| | | | | | | x LED 14
So, for example:<br>
To light the first 5 red LEDs in quadrant 2:
D 22 22 02 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2 and 4:
D 66 66 06 00 00 00 00 00
To light the first 5 red LEDs in quadrant 2, and the last 5 red LEDs in quadrant 4:
D 22 22 02 00 00 04 44 44
The syntax is identical for green and blue, but you should use the "E" and "F" command instead of the "D" command.
==== Setting the time ====
===== Over USB =====
It is possible to set the time over a USB-serial port, using the "T" command.<br>
Usage:
T [hh] [mm] [ss]
With hh, mm, and ss in hexadecimal. For example:
T 10 2F D
sets the time to 16:47:13 .<br>
<br>
At BitWizard, we use the following script (we called it tsync) to set the time:
#!/bin/sh
h=`(echo obase=16 ;date +"%H" )| bc`
m=`(echo obase=16 ;date +"%M" )| bc`
s=`(echo obase=16 ;date +"%S" )| bc`
echo T $h $m $s
Forward the output of this script to the clock, to set the time:
./tsync > /dev/ttyACM0
===== Using the pushbuttons =====
Switch 2: Push to jump one hour forward<br>
Switch 3: Push to jump 1 minute forward<br>
Switch 4: Push to reset the seconds to 0<br>
==== Reading back the time ====
The "t" command outputs the current time on the clock over the serial interface:
CDC usbio/usbmultiio Wed Jan 11 18:28:22 CET 2012
> t 11:2F:03.02E0
>
The time is printed in hex, in hh:mm:ss.milliseconds
==== Adjusting the white-balance ====
===== Over USB =====
Setting the white-balance can be done with the "B" command.<br>
Usage:
B [rValue] [gValue] [bValue]
Values are in hex. Example (this is the default setting):
B 7800 7E00 0000
This means the red LED is on from 0x0000 until 0x7800, green is on from 0x7800 until 0x7E00, and blue is on from 0x7E00 until 0x0000.<br>
This counter counts from 0x0000 to 0xBB80.
Because the interrupt routine takes some time too, there is a minimum interval between two interrupts. This minimum was measured to be between 0x600 and 0x700. I recommend you do not set the interval between two interrupts shorter than about 0x800.<br>
===== Using the pushbuttons =====
Not yet implemented.
==== Jump to bootloader ====
If you want to flash the controller, you need to switch to the bootloader. You can do this by pressing the pushbutton of the multio, of if you're lazy (or if the clock is hanging on a wall on the other side of the room) you can do it by issuing the "z" command.
== Technical Specifications: ==
Power usage: Approximately 30mA with default firmware.
== Future hardware enhancements ==
* Replace 2 12-pin connectors by 1 20-pin connector
* Add numbers to the pushbutton switches
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
49a4710bf3cf9aecfdf6ebf0ca66cc1ece1e0e5b
Blog 14
0
1815
3725
3511
2015-12-02T10:54:27Z
Cartridge1987
2553
/* Arduino version */
wikitext
text/x-wiki
== The BigRelay board ==
In this post I will show my scripts for Raspberry Pi and Arduino, where I will let every relay one after another turn on and off.
This can be a handy script, if you want to give a quick look if all the relays work.
Hardware I used for the Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/bigrelay BigRelay board] | ([[Relay]])
Hardware I used for the Arduino:
*[http://www.bitwizard.nl/shop/lcd-interface SPI_LCD board] | ([[LCD]])
*[http://www.bitwizard.nl/shop/bigrelay BigRelay board] | ([[Relay]])
== Raspberry Pi version ==
The script of the bash program:
#!/bin/bash
OnTime=1
OffTime=0
bigrelay="bw_tool -s 50000 -a 9c"
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
}
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
OnTime=1
OffTime=0
With OnTime and OffTime you can easily change the time of the relay being on or off. In this way you don't have to be searching in the script, where to change it.
bigrelay="bw_tool -s 50000 -a 9c"
This is for saying that with 'bigrelay' it has to do a command to the bigrelay.
trap onexit 1 2 3 15 ERR
function onexit() {
$bigrelay -W 10:0:b
exit
}
This is an onexit script, which makes it happen that when you leave the script with ctrl + c or an error that it will directly put all the relays in the off-state.
function dorelay() {
$bigrelay -W "$1":01:b
sleep $OnTime
$bigrelay -W "$1":00:b
sleep $OffTime
Here it will read the turn on and off times, the given relay number and will perform the on/off cycle on that relay.
while true; do
for i in `seq 20 25` ; do
dorelay $i
done
done
Here it will iterate the variable i from 20 to 25 and will run activate the doreplay function on each iteration.
== Arduino version ==
The script from the arduino program:
int offms = 500;
int onms = 1000;
unsigned int s = 0;
void loop (void)
{
static int num = 0x20;
char buf[32];
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
sprintf (buf, "Times: %u", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
This is not the full script! I used a script named [http://www.bitwizard.nl/software/ ardemo_lcd.pde], but I only replaced the void loop part. ( That is the part you are seeing on this page )<br> If you want a link to the full script: [http://www.bitwizard.nl/source/BigRelayWiki.ino Click here!]
int offms = 500;
int onms = 1000;
Here you can set the time in milliseconds for how long you the relay to turn on and off. You could also change the numbers in the delay command, but this makes it easier to find.
unsigned int s = 0;
This will tell the script to start at 0 and to be an unsigned int. An unisgned int can get a larger value than a signed int.
static int num = 0x20;
The above line will make it happen that when you upload the code it will directly start with relay 1(0x20).
set_var (0x9c, 0x10, 0x00);
delay(offms);
set_var (0x9c, num, 0x01);
delay(onms);
It says to BigRelay (0x9c) that register 10(0x10) has to be zero (0x00).
So in other words all the relays on the BigRelay have to be turned off.
( You can also change register 10 into num, and put it under the turn on command. )
offms, onms and num will read the last values that were given to them. So at num when counting up it will become 21.
if (num < 0x25) num++;
else {
num = 0x20; s++;
}
Here I let num couting up with 1 every time a relay has been activated. After it reached above 25(0x25) it will start over again at 20(0x20).
After it begins again with 20(0x20) I also count up with 1 s, this will be send to the display to say how many times it finished a full round clicking.
sprintf (buf, "Times: %u ", s);
write_at_lcd (0, 0, buf);
sprintf (buf, "Relay: %d", num-0x20+1);
write_at_lcd (0, 1, buf);
Serial.write (buf);
Serial.write ("\r\n");
Here it says to the display to print the text "Times:" ( for showing how many times it did all the relays ) and "relay:" ( for showing which relay is turned on ).
The %d is for showing it in decimals and %u for showing in unsigned decimals. ( if you do %02d 1 will become 01. )
"num -0x20+1" counts 20 hexadecimals off num and after that counts 1 up. So, example: 25-20=5+1 = 6.
( if you count 19 or 21 hexadecimals down you would get a really different result. )
[[File:ArduinoBigRelay.jpg|400px|thumb|none|]]
The green cable of pin 6 is connected with D10 off the arduino, that is needed for the chip select. So you could control multiple devices, like the BigRelay and the LCD.
== Useful links ==
*Working with a 7FETs Stepper motors [[Blog 15]]
*Working with multiple 7FETs Stepper motors [[Blog 16]]
*Example script for working with arduino from BitWizard: [http://www.bitwizard.nl/software/ ardemo_lcd.pde]
60244f50fddb08e623b3b521bb7f71d6eefdbf62
Blog list
0
1798
3726
3679
2015-12-04T10:47:06Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
[RP] = Raspberry Pi
[A] = Arduino
*[[Blog 01]] - [RP] Starting up the Raspberry Pi
*[[Blog 02]] - [RP] Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - [RP] !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - [RP] !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - [RP] !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - [RP] !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - [RP] !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - [RP] Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - [RP] Online weather station
*[[Blog 10]] - [RP] Pushbutton menu
*[[Blog 11]] - [RP] Turning off and on a lamp with crontab on special times
*[[Blog 12]] - [RP] Alarm Menu
*[[Blog 13]] - [RP] Scroll Menu
*[[Blog 14]] - [RP][A] BigRelay checker
*[[Blog 15]] - [RP][A] Basic stepper motor
*[[Blog 16]] - [RP] Working with two stepper motors.
*[[Blog 17]] - [RP] Making a 2 wheeled car ( Stepper Motor / electric wheel )
*[[Blog 18]] - [RP] Settings menu, where you can change the contrast, backlight and volume of your Raspberry pi.
*[[Blog 19]] - [A] Arduino double wheeled var versions ( Stepper motor / electric wheel )
*[[Blog 20]] - [A] !BETA! Explanation from the SPI and I2C example code
617cad5d674e2edf4f6a003c3f8b181eacaf3719
Blog 18
0
1830
3727
3654
2015-12-04T13:53:40Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Settings Menu ==
Hardware I used on my Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
Programmed with:
*bash
*[[Bw tool]]
In this post I will show the menu I made, where you can change the: Backlight, Contrast and Volume.
The overall script is based on the scroll menu from [[blog 13]].
You can scroll through the menu with button 5(up) and 6(down). On the screen there will be visible which of the 2 menu you can go to.
With button 1 and 2 you can choose which of the 2 you want to use.
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( Volume Contrast Backlight )
# Element 0 1 2
Narray=( VOLUME CONTRAST BACKLIGHT )
# Element 0 1 2
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
./${array[$Number]}
fi
if [ $BUTTON = "10" ]; then
./${array[$Numb2]}
fi
if [ $BUTTON = "08" ]; then
Number=0
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 2) % 3 ))
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 3 ))
fi
Numb2=$((Number + 1))
Numb3=$((Numb2 + 1))
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2""."${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:20
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb3""."${Narray[$Numb2]}
sleep 1
done
[[File:BacklightHigh.jpg|400px|thumb|none|]]
=== Backlight/Contrast ===
This is the script for changing the backlight. The script for changing the contrast is almost the same. The only difference is that instead of writing to protocol 13 you write to protocol 12.
So
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
Has to become
bw_tool -I -D /dev/i2c-1 -a 94 -W 12:${array[$Number]}
#!/bin/bash
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
Number=$(((Number + 10) % 11 )) # can be changed to 11 if you want it to get 1 down
fi
if [ $BUTTON = "01" ]; then
Number=$(((Number + 1) % 11 )) #can be changed to 1 if you want to get it up by 1
fi
bw_tool -I -D /dev/i2c-1 -a 94 -W 11:00
bw_tool -I -D /dev/i2c-1 -a 94 -t "$Numb2"${Narray[$Number]}
bw_tool -I -D /dev/i2c-1 -a 94 -W 13:${array[$Number]}
sleep 1
done
array=( 00 19 33 4c 66 7F 99 B2 CC E5 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10
Narray=( 00 10 20 30 40 50 60 70 80 90 100 )
# Name 0 1 2 3 4 5 6 7 8 9 10
The Array counts in hexadecimals, because protocol 13 and 12 work in hexadecimals. FF is in decimals 255. I just used an easy trick to get a tenth of 255. What is 25.5. What is around 19 in hexadecimals. After that I kept counting 19 up the hexadecimal number, until I reached FF. Now it got good steps between every time up and down.
I made the Narray (text that will get displayed), because it is easer for people to understand 0 till 100, than 00 till FF.
[[File:BacklightLow.jpg|400px|thumb|none|]]
=== Volume ===
The script makes it possible to make the audio 5/10 decibel louder or quieter.
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
To script will at the end read at which volume percentage the audio is. With the grep and sed -e it will remove all the information outside the volume percentage. Normally without sed -e it would look like:
Mono: Playback -600 [91%] [-6.00dB] [on]
In [[blog 09]] there is a deeper explanation about grep and the sed -e.
#mplayer ru.mp3
After every '#' I put an audio file, this is optional but there you could put a short audio file. So, that you can directly hear how loud the audio is.
#!/bin/bash
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
while true; do
BUTTON=`bw_tool -I -D /dev/i2c-1 -a 94 -R 30:b`
if [ $BUTTON != "00" ]; then
bw_tool -I -D /dev/i2c-1 -a 94 -W 10:00
fi
if [ $BUTTON = "20" ]; then
amixer -c 0 set PCM 5dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "10" ]; then
amixer -c 0 set PCM 5dB+
#mplayer ru.mp3
fi
if [ $BUTTON = "04" ]; then
exit
fi
if [ $BUTTON = "02" ]; then
amixer -c 0 set PCM 10dB-
#mplayer ru.mp3
fi
if [ $BUTTON = "01" ]; then
amixer -c 0 set PCM 10dB+
#mplayer ru.mp3
fi
$DISPL -W 11:00:b
$DISPL -t `amixer | grep Mono: | sed -e 's/%] .*//' -e 's/.* \[//'`
sleep 1
done
== Useful links ==
*[[User Interface]]
*[[Blog 09| Temperature Station]], this can give extra information of how to work with grep.
*[[Blog 13| Scroll Menu]], this can give more explanation about the scripting.
*[http://linux.die.net/man/1/amixer For more information about the amixer]
f3c0ad3a20635931869635208afba2a64627b10e
LCD + 3FETs demonstration
0
1221
3728
1914
2015-12-04T15:25:47Z
Cartridge1987
2553
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=enJEksPqWqo
= Things we used =
* [http://www.bitwizard.nl/shop/breakout-boards/dio-breakout-board RPi Serial Breakout board]
* [www.bitwizard.nl/shop/6-pin-idc-cable-15cm SPI cable]
* [www.bitwizard.nl/shop/lcd-interface-16x2 SPI LCD]
* [http://www.bitwizard.nl/shop/3fets SPI 3FETs]
* Common-Anode RGB LED strip
* 12V Power supply
= Steps to take =
Since we want to display different texts on two daisy-chained display's, we needed to change the address of one of the display's:
* Only connect the display who's address you want to chacnge, to the SPI0 port of your RPi
* Execute the following command: "sudo ./bw_lcd -a 82 -r 240 -v 128
Now this display should be listening on port 80.
Now connect al the SPI modules in one chain, hook up the power supply and LED strip to the 3FETs board, and run the following script as root:
#!/bin/sh
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
# Print welcome message to LCDs
./bw_lcd -a 80 -T 0,0 'Raspberry Pi'
./bw_lcd -a 80 -T 0,1 'controlling two'
./bw_lcd -a 82 -T 0,0 'LCD modules and'
./bw_lcd -a 82 -T 0,1 'an RGB LED strip'
#Enable PWM on 3FETs board
./bw_lcd -a 8A -r 95 -v 7
sleep 2
#Play with colors
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 "Let's try some"
./bw_lcd -a 80 -T 0,1 'simple colors'
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Red'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Yellow'
./bw_lcd -a 8A -r 81 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Green'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Cyan'
./bw_lcd -a 8A -r 80 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'White'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Violet'
./bw_lcd -a 8A -r 81 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Blue'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 ''
./bw_lcd -a 8A -r 80 -v 0
sleep 1
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 'Nice, eh?'
e1f1c2d719670ec68f0d19753f326f8fe0313696
3729
3728
2015-12-04T15:26:42Z
Cartridge1987
2553
/* Things we used */
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=enJEksPqWqo
= Things we used =
* [http://www.bitwizard.nl/shop/breakout-boards/dio-breakout-board RPi Serial Breakout board]
* [http://www.bitwizard.nl/shop/6-pin-idc-cable-15cm SPI cable]
* [http://www.bitwizard.nl/shop/lcd-interface-16x2 SPI LCD]
* [http://www.bitwizard.nl/shop/3fets SPI 3FETs]
* Common-Anode RGB LED strip
* 12V Power supply
= Steps to take =
Since we want to display different texts on two daisy-chained display's, we needed to change the address of one of the display's:
* Only connect the display who's address you want to chacnge, to the SPI0 port of your RPi
* Execute the following command: "sudo ./bw_lcd -a 82 -r 240 -v 128
Now this display should be listening on port 80.
Now connect al the SPI modules in one chain, hook up the power supply and LED strip to the 3FETs board, and run the following script as root:
#!/bin/sh
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
# Print welcome message to LCDs
./bw_lcd -a 80 -T 0,0 'Raspberry Pi'
./bw_lcd -a 80 -T 0,1 'controlling two'
./bw_lcd -a 82 -T 0,0 'LCD modules and'
./bw_lcd -a 82 -T 0,1 'an RGB LED strip'
#Enable PWM on 3FETs board
./bw_lcd -a 8A -r 95 -v 7
sleep 2
#Play with colors
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 "Let's try some"
./bw_lcd -a 80 -T 0,1 'simple colors'
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Red'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Yellow'
./bw_lcd -a 8A -r 81 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Green'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Cyan'
./bw_lcd -a 8A -r 80 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'White'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Violet'
./bw_lcd -a 8A -r 81 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Blue'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 ''
./bw_lcd -a 8A -r 80 -v 0
sleep 1
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 'Nice, eh?'
2feda886ddc257bc80a35bdb4b30bf85e85356c9
Connecting a motor and 1602 LCD to a Raspberry Pi
0
1223
3730
1917
2015-12-04T15:55:37Z
Cartridge1987
2553
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=zSQDuy-uu8I
= Things we used =
* [http://www.bitwizard.nl/shop/6-pin-idc-cable-15cm SPI cable]
* [http://www.bitwizard.nl/shop/7fets SPI 7FETs]
* [www.bitwizard.nl/shop/lcd-interface-16x2 ]
* Small electric motor
We chose a small DC motor which works on 5VDC, so we could power it directly from the RPi. It is, however, possible to connect an external power supply, to drive motors (or other stuff) which require a different voltage then the 5V provided by the Pi.
= Steps to take =
We split this up in two seperate scripts:
set_pwm
#!/bin/sh
pwmval=$1
bw_tool -C -t "BW spi 7fets PWM"
bw_tool -w 11:20
bw_tool -t "test: $pwmval"
bw_tool -a 88 -w 50:$pwmval
test_pwm
#!/bin/sh
./set_pwm 58
./set_pwm 48
sleep 4
for i in 50 60 70 80 90 a0 b0 c0 d0 e0 f0 ff ; do
./set_pwm $i
sleep 0.5
done
sleep 1
for i in ff f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 0 ; do
./set_pwm $i
sleep 0.5
done
Put both scripts in your homedir, and run the test_pwm script as root, and you're done!
bf02f8008fbc16cb6102f04364e14fa9cc5c7fc2
3731
3730
2015-12-04T15:55:55Z
Cartridge1987
2553
/* Things we used */
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=zSQDuy-uu8I
= Things we used =
* [http://www.bitwizard.nl/shop/6-pin-idc-cable-15cm SPI cable]
* [http://www.bitwizard.nl/shop/7fets SPI 7FETs]
* [http://www.bitwizard.nl/shop/lcd-interface-16x2 ]
* Small electric motor
We chose a small DC motor which works on 5VDC, so we could power it directly from the RPi. It is, however, possible to connect an external power supply, to drive motors (or other stuff) which require a different voltage then the 5V provided by the Pi.
= Steps to take =
We split this up in two seperate scripts:
set_pwm
#!/bin/sh
pwmval=$1
bw_tool -C -t "BW spi 7fets PWM"
bw_tool -w 11:20
bw_tool -t "test: $pwmval"
bw_tool -a 88 -w 50:$pwmval
test_pwm
#!/bin/sh
./set_pwm 58
./set_pwm 48
sleep 4
for i in 50 60 70 80 90 a0 b0 c0 d0 e0 f0 ff ; do
./set_pwm $i
sleep 0.5
done
sleep 1
for i in ff f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 0 ; do
./set_pwm $i
sleep 0.5
done
Put both scripts in your homedir, and run the test_pwm script as root, and you're done!
91e05396974e7147023665e2df120a2ad1cd5adc
Connecting a motor and 1602 LCD to a Raspberry Pi
0
1223
3732
3731
2015-12-04T15:58:04Z
Cartridge1987
2553
/* Things we used */
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=zSQDuy-uu8I
= Things we used =
* [http://www.bitwizard.nl/shop/6-pin-idc-cable-15cm SPI cable]
* [http://www.bitwizard.nl/shop/7fets SPI 7FETs]
* [http://www.bitwizard.nl/shop/lcd-interface-16x2 LCD interface]
* Small electric motor
We chose a small DC motor which works on 5VDC, so we could power it directly from the RPi. It is, however, possible to connect an external power supply, to drive motors (or other stuff) which require a different voltage then the 5V provided by the Pi.
= Steps to take =
We split this up in two seperate scripts:
set_pwm
#!/bin/sh
pwmval=$1
bw_tool -C -t "BW spi 7fets PWM"
bw_tool -w 11:20
bw_tool -t "test: $pwmval"
bw_tool -a 88 -w 50:$pwmval
test_pwm
#!/bin/sh
./set_pwm 58
./set_pwm 48
sleep 4
for i in 50 60 70 80 90 a0 b0 c0 d0 e0 f0 ff ; do
./set_pwm $i
sleep 0.5
done
sleep 1
for i in ff f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 0 ; do
./set_pwm $i
sleep 0.5
done
Put both scripts in your homedir, and run the test_pwm script as root, and you're done!
e2c121ff67e6e7f8824d65d46b3700cbb3e9f364
3733
3732
2015-12-04T15:58:27Z
Cartridge1987
2553
/* Things we used */
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=zSQDuy-uu8I
= Things we used =
* [http://www.bitwizard.nl/shop/6-pin-idc-cable-15cm SPI cable]
* [http://www.bitwizard.nl/shop/7fets SPI 7FETs]
* [http://www.bitwizard.nl/shop/lcd-interface-16x2 SPI LCD interface]
* Small electric motor
We chose a small DC motor which works on 5VDC, so we could power it directly from the RPi. It is, however, possible to connect an external power supply, to drive motors (or other stuff) which require a different voltage then the 5V provided by the Pi.
= Steps to take =
We split this up in two seperate scripts:
set_pwm
#!/bin/sh
pwmval=$1
bw_tool -C -t "BW spi 7fets PWM"
bw_tool -w 11:20
bw_tool -t "test: $pwmval"
bw_tool -a 88 -w 50:$pwmval
test_pwm
#!/bin/sh
./set_pwm 58
./set_pwm 48
sleep 4
for i in 50 60 70 80 90 a0 b0 c0 d0 e0 f0 ff ; do
./set_pwm $i
sleep 0.5
done
sleep 1
for i in ff f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 0 ; do
./set_pwm $i
sleep 0.5
done
Put both scripts in your homedir, and run the test_pwm script as root, and you're done!
8bb13e53c5b05becec6d8fe6d79c0f756e7a8cac
LCD + 3FETs demonstration
0
1221
3734
3729
2015-12-04T16:01:47Z
Cartridge1987
2553
/* Things we used */
wikitext
text/x-wiki
This page describes the demo that can be found on the following youtube link: http://www.youtube.com/watch?v=enJEksPqWqo
= Things we used =
* [http://www.bitwizard.nl/shop/6-pin-idc-cable-15cm SPI cable]
* [http://www.bitwizard.nl/shop/lcd-interface-16x2 SPI LCD]
* [http://www.bitwizard.nl/shop/3fets SPI 3FETs]
* Common-Anode RGB LED strip
* 12V Power supply
= Steps to take =
Since we want to display different texts on two daisy-chained display's, we needed to change the address of one of the display's:
* Only connect the display who's address you want to chacnge, to the SPI0 port of your RPi
* Execute the following command: "sudo ./bw_lcd -a 82 -r 240 -v 128
Now this display should be listening on port 80.
Now connect al the SPI modules in one chain, hook up the power supply and LED strip to the 3FETs board, and run the following script as root:
#!/bin/sh
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
# Print welcome message to LCDs
./bw_lcd -a 80 -T 0,0 'Raspberry Pi'
./bw_lcd -a 80 -T 0,1 'controlling two'
./bw_lcd -a 82 -T 0,0 'LCD modules and'
./bw_lcd -a 82 -T 0,1 'an RGB LED strip'
#Enable PWM on 3FETs board
./bw_lcd -a 8A -r 95 -v 7
sleep 2
#Play with colors
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 "Let's try some"
./bw_lcd -a 80 -T 0,1 'simple colors'
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Red'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Yellow'
./bw_lcd -a 8A -r 81 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Green'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Cyan'
./bw_lcd -a 8A -r 80 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'White'
./bw_lcd -a 8A -r 82 -v 255
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Violet'
./bw_lcd -a 8A -r 81 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 'Blue'
./bw_lcd -a 8A -r 82 -v 0
sleep 1
./bw_lcd -a 82 -C
./bw_lcd -a 82 -T 0,0 ''
./bw_lcd -a 8A -r 80 -v 0
sleep 1
./bw_lcd -a 80 -C
./bw_lcd -a 82 -C
./bw_lcd -a 80 -T 0,0 'Nice, eh?'
71e320e4971f5349577ff9860752cc8d0434a384
Stmwifi
0
1751
3735
3040
2015-12-04T16:08:54Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the documentation page for the STMWIFI board.
== Overview ==
The board has a connector for an ESP8266 WIFI module, an USB port and a bunch of IO connectors.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
The FET outputs on the "ODO" pins are capable of sinking about 1A per output. We have tested 1A and the FET became slightly warm, as predicted by theory.
Although the specifications for the FETs allow a larger current, it is not recommended to exceed the 1A max we specify.
=== Possible Configurations ===
We recommend powering the board through an USB connector.
Currently the firmware does not yet support enumerating as an USB device. This should become available in the future.
The "console" of the device is currently on the connector called "UART". Connect a TTL-level usb-serial device there. The baud rate is 115200.
The J2-J6 connectors provide an easy way to connect three-pin-sensors. For example DHT11, DHT22, or DS18S20. Future firmware may support using the connectors as a servo output. The pinout is prepared for servos: 1-GND, 2-VCC, 3-signal. The signal pins are connected to PA4, PA5, PA7, PA8, PB1 respectively.
the SV3 connector provides 16 GPIO pins. These are connected to GPIOC.
The ODO (I don't remember what that stands for) connector provides VCC (5V or 3.3V), GND and 4 open drain outputs. You could drive a 5-pin stepper with this, or a led strip. There is no flyback diode, so if you're driving inductive loads, you should provide one yourself.
The chip has two I2C modules that are brought out to an I2C connector. You might be able to use these as GPIO or more sensors too. No real firmware support for I2C yet.
The SPI bus is brought out to the SPI connector. The pinout is the same as for AVR ICSP connectors (and documented elsewhere on this wiki). The firmware currently initializes the SPI module, and allows sending text to the BitWizard SPI LCD modules.
== External resources ==
=== Datasheets ===
* The STM32F072 datasheet: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00090510.pdf
* The STM32F0x2 reference manual: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/DM00031936.pdf
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
The output connector is connected as follows:
{| border=1
! pin !! function !!
|-
| 1 || OUT0 ||
|-
| 2 || OUT1 ||
|-
| 3 || OUT2 ||
|-
| 4 || V+ ||
|-
| 5 || V+ ||
|-
| 6 || V+ ||
|-
| 7 || GND ||
|-
| 8 || GND ||
|}
The "V+" is a convenience connector. The GND of your powersupply needs to be connected to GND, and your load goes between the plus of your powersupply and the "OUT" signals. You could wire it directly from the powersupply, or you can connect the powersupply to the "V+" here, and the loads between another V+ and the OUTx connector.
This board does not provide a protection diode between the OUTx signals and V+. This allows you to connect say a 5V powersupply to V+ and use OUT1 and OUT2 for 5V devices, while you connect a 12V load between OUT0 and a 12V powersupply. (the protection diode would allow the 12V powersupply to feed the 5V line through the 12V load and the protection diode when the 12V load was meant to be off.)
The MOSFETs that we use are specified to be able to handle an inductive kickback. This means they will survive an occasional inductive spike, but not when you trigger that too often, say by putting the output in PWM mode.
So, if you have an inductive load you will need to provide your own protection diode, especially if you're going to use the PWM mode.
=== LEDs ===
The only LED is a power-LED.
=== Block diagram ===
Here is a block diagram of the board.
[[file:3fets.png]]
== Power connector ==
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
1bfcac74f36e5599455fba65fcad6b0cf93a1ef9
Analog inputs
0
1593
3736
3462
2015-12-09T13:12:57Z
Cartridge1987
2553
/* adding and averaging */
wikitext
text/x-wiki
= Analog inputs =
Several boards can be configured to use analog inputs. The registers 0x70-0x78 specify the value for the multiplexer register in the ADC module of the used chip. The value is not santiy checked. Any value you specify will be used. It is not expected that things will break if you send a value that is not documented here, but why risk it?
== Reference ==
The top two bits specify the reference. Possible values are:
0x80: internal 1.1V
0x00: 5V (or 3.3V) powersupply line.
Other values are not applicable (0x40 = use aref pin, which is connected elsewhere on the bitwizard boards, 0xc0 is "reserved").
== Normal measurements ==
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! dio pin !! temp || thermo
|-
| 0x00 || 6 || S2 || T4
|-
| 0x01 || 4 || S1 || T3
|-
| 0x02 || 3 || S3 || T2
|-
| 0x03 || 1 || S4 || T1
|-
| 0x07 || 0 || - || -
|-
|}
The values 4, 5 and 6 would measure analog values on the pins required for I2C or SPI communication. Interesting to do once, but not particularly useful. These values are added to the "reference selection" value in the previous section.
There are also some special values internal to the chip:
{| border=1
! value !! what
|-
| 0x20 || AGND
|-
| 0x21 || 1.1V reference
|-
| 0x22 || temp sensor
|-
|}
You should get "about 0" if you use mux value 0x20. Maybe this can be used to measure the offset of the ADC module. By measuring the 1.1V reference with the power rails as the reference, you can get a measurement of the power supply value.
The temp sensor should give you the temperature in C with about 275 added. The datasheet mentions a typical value of 300 at 25C. The coefficient is documented as "close to 1.0", but a few lines up it is documented (indirectly) as "typically 1.077". The offset is apparently quite variable. So don't count on any absolute accuracy. You'll need to calibrate the offset if you want any kind of accuracy. (If the real temp is 21 degrees (comfortable), the reading could easily end up at 16 or 26, which are clearly too cold and too hot for comfort).
== Differential measurements ==
Differential measurements use one pin as the positive input and another as the negative. In the bitwizard boards only "single sided" measurements are supported. This means that if your signal can go both ways, you have to switch to the other polarity once your measured value is below a certain value. Note that you cannot count on the value becoming zero if the polarity reverses. There will always be a little bit of noise resulting in non-zero ADC conversions even if the input polarity is reversed. You could also request both conversion values, and decide what to do with them in your software. The hardware does not support all combinations. So it might be possible that sometimes you cannot measure a polarity. Casual inspection shows that this does not happen in the subset of inputs available on the bitwizard boards.
In the table below you'll see for instance 6-4 in the dio column, this means that the ADC value represents the voltage of dio pin 6 minus dio pin 4.
This table was difficult to figure out.... It may still contain errors. Please report them if you see one.
{| border=1
! value !! dio pins !! temp || thermo
|-
| 0x08 || 6 - 4 || S2 - S1 || T4 - T3 *
|-
| 0x0a || 6 - 1 || S2 - S4 || T4 - T1
|-
| 0x28 || 4 - 6 || S1 - S2 || T3 - T4 *
|-
| 0x0c || 4 - 3 || S1 - S3 || T3 - T2
|-
| 0x0e || 4 - 1 || S1 - S4 || T3 - T1
|-
| 0x2c || 3 - 4 || S3 - S1 || T2 - T3
|-
| 0x10 || 3 - 1 || S3 - S4 || T2 - T1 *
|-
| 0x2a || 1 - 6 || S4 - S2 || T1 - T4
|-
| 0x2e || 1 - 4 || S4 - S1 || T1 - T3
|-
| 0x30 || 1 - 3 || S4 - S3 || T1 - T2 *
|-
| 0x24 || 1 - 1 || S4 - S4 || T1 - T1
|-
| 0x18 || 1 - 0 || - || -
|-
| 0x38 || 0 - 1 || - || -
|-
| 0x26 || 0 - 0 || - || -
|}
Thermo lines marked with the asterisk are the intended use for the thermocouple board.
Hmm. Maybe a different table is more useful / easier to read in our application. Let me try this:
{| border=1
! !! DIO6 <br> S2 <br> T4 !! DIO4 <br> S1<br>T3 || DIO 3 <br> S3<br>T2 || DIO 1 <br>S4<br>T1 || DIO 0
|-
| DIO6<br> S2 T4 || 0x22* || 0x08 || - || 0x0a || -
|-
| DIO4<br>S1 T3 || 0x28 || - || 0x0c || 0x0e || -
|-
| DIO3<br>S3 T2 || - || 0x2c || - || 0x10 || -
|-
| DIO1<br>S4 T1 || 0x2a || 0x2e || 0x30 || 0x24 || 0x18
|-
| DIO0 || - || - || - || 0x38 || 0x26
|}
The 0x22* value only works in "x20" mode with "1" added as described below.
The "DIO0" indication means IO 0 on the DIO board. In the pinout of the DIO board, you can see that this is pin 3 on the connector. and so on.
The "S1" indication means the "sensor 1" input on the "temp" board (which is the middle pin of the 3-pin connector marked S1).
The rows describe a positive input, the columns a negative one. So row "S1", column "S3" describes the value to use for S1-S3.
== Differential x20 measurements ==
For measuring small differences, there is a x20 gain mode. The measurements are very similar to the above differential measurements, but the analog value is multiplied by 20 before being measured. The datasheet for the chip doesn't clearly describe how accurate the "20" here is.
Add one to the values in the above table to obtain the x20 measurements.
= Adding and averaging =
By setting a value into the <samples-to-add> register (0x81), you can add samples together. By setting a value in the <number-of-bits-to-shift-the-result> register (0x82) you can divide down (but only by powers of two) to get an average.
Statistics have shown that under certain circumstances, adding a number of samples together will provide a higher resolution than the underlying ADC. In the BitWizard boards, those circumstances are almost always present. One thing to remember is that when you add together say 64 ten-bit samples, you get a 16-bit result. Almost all 16-bit values are possible. However your measurement has not become 16-bits. In practise, you need to average 2^2n samples, to get n more bits of resolution. So to get a full 16-bit result, you need 6 more bits of resolution (n=6), so you need to add 2^12 (4096) samples together.
5d570b93994434258a90c7da840c416a9dc0a5bf
DIO protocol
0
432
3737
3669
2015-12-09T14:57:38Z
Cartridge1987
2553
/* Write Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
d6ae2528865e386bf89b5672f4b722bd42124da8
3738
3737
2015-12-09T15:01:35Z
Cartridge1987
2553
/* Read Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x27 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x67 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
154fc16f0a9229f1f3c6e8ecf55024d59ea37930
3739
3738
2015-12-09T15:03:39Z
Cartridge1987
2553
/* Read Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x27 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x77 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
e6c678dc655f4140f3c63ebda882e9e1970ef592
3740
3739
2015-12-09T15:04:20Z
Cartridge1987
2553
/* Write Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
26e2f40d82dd9bb2bdaf9b597ced943b6363b905
3743
3740
2015-12-09T15:27:29Z
Cartridge1987
2553
/* Read Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. I.e. if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
ee4aee01f00b3a7d731e706afbfe81e81bac56aa
3744
3743
2015-12-09T16:38:26Z
Cartridge1987
2553
/* Write Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output.
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc.
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. It is if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
12243f408745150136c6898926167c04f8329f03
3756
3744
2015-12-14T11:39:59Z
Cartridge1987
2553
/* Write Ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output. (Read: Using the digital ports)
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc. (Read: Using the digital ports)
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. It is if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
d80d16b5f71cfdd4fb7db227086f9e04b1390868
3757
3756
2015-12-14T12:49:27Z
Cartridge1987
2553
/* Using the digital ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output. (Read: Using the digital ports)
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc. (Read: Using the digital ports)
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. It is if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
== BitMask Value for every pin ==
{| border=1
! Pin !! Function !! value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
c65c7f9fcc40976dc7d700a85f5a9104463174a2
3758
3757
2015-12-14T12:49:49Z
Cartridge1987
2553
/* BitMask Value for every pin */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output. (Read: Using the digital ports)
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc. (Read: Using the digital ports)
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. It is if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
== BitMask value for every pin ==
{| border=1
! Pin !! Function !! value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
e93d584d258413324466d8333fc7ff9282cdd8eb
3759
3758
2015-12-14T12:52:41Z
Cartridge1987
2553
/* BitMask value for every pin */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output. (Read: Using the digital ports)
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc. (Read: Using the digital ports)
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. It is if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
== BitMask value for every pin ==
{| border=1
! Pin !! Function !! Value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
cba69cea2320feb85d48199a8305f803f1c95210
DIO
0
52
3741
3470
2015-12-09T15:05:48Z
Cartridge1987
2553
/* Pinout */
wikitext
text/x-wiki
[[File:SPI_DIO.jpg|thumb|300px|alt=The DIO board|The DIO board (depicted: the SPI version)]]
This is the documentation page for the SPI_DIO and I2C_DIO boards. That you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/dio BitWizard shop].
== Overview ==
This board enables you to read and write up to 7 digital IO lines. And although the "d" in dio stands for "digital", it now also allows you to configure and use some of the IO lines as [http://www.bitwizard.nl/wiki/index.php/Analog_inputs analog inputs!]
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! analog?
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0 || yes
|-
| 4 || IO1 || yes
|-
| 5 || IO2 || no
|-
| 6 || IO3 || yes
|-
| 7 || d.n.c.
|-
| 8 || IO4 ||yes
|-
| 9 || IO5 ||no
|-
| 10 || IO6 ||yes
|}
d.n.c. means do not connect.
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector SPI1 (nearest the board edge) into an ICSP programming connector for the attiny44 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[DIO_protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
c863fc4f2a4a0f176c8343b6daf442c87373e8aa
Dio breakout
0
1659
3742
2572
2015-12-09T15:08:00Z
Cartridge1987
2553
/* Pinout */
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
d.n.c. means do not connect.
== jumper settings ==
There are no jumpers.
== configurations ==
You can chose to have your board equipped with a 10-pin female connector that allows your board to directly fit on top of the I2C-DIO board. This would conflict with the SPI connectors so don't chose this option for an SPI_DIO.
You can chose to have your board equipped with a male 10-pin connector that allows you to connect your board with the SPI_DIO or I2C DIO using a short 10pin IDC cable.
== Future hardware enhancements ==
may 2013: This is vaporware: hardware will be available june 2013.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
7703d33cae524ed5fc65e0eaf8216e17488399ad
3750
3742
2015-12-10T12:06:06Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:DIO_breakout.jpg|thumb|300px|alt=The DIO breakout board|The DIO breakout board.]]
This is the documentation page for the DIO_breakout .
== Overview ==
This board enables use screw terminals to connect wires to your SPI_DIO or I2C_DIO board.
== Assembly instructions ==
None: the board comes fully assembled.
=== Related projects ===
[[DIO]]
== Pinout ==
The connector at the bottom of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || IO0
|-
| 3 || IO1
|-
| 4 || IO2
|-
| 5 || IO3
|-
| 6 || IO4
|-
| 7 || IO5
|-
| 8 || IO6
|}
the power-connector at the top of the board is laid out as follows:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || GND
|-
| 4 || VCC
|-
| 5 || GND
|-
| 6 || VCC
|-
| 7 || GND
|-
| 8 || VCC
|}
The dataconnector in the middle of the board is compatible with the DIO board:
{| border=1
! pin !! function
|-
| 1 || GND
|-
| 2 || VCC
|-
| 3 || IO0
|-
| 4 || IO1
|-
| 5 || IO2
|-
| 6 || IO3
|-
| 7 || d.n.c.
|-
| 8 || IO4
|-
| 9 || IO5
|-
| 10 || IO6
|}
d.n.c. means do not connect.
== Jumper settings ==
There are no jumpers.
== Configurations ==
You can chose to have your board equipped with a 10-pin female connector that allows your board to directly fit on top of the I2C-DIO board. This would conflict with the SPI connectors so don't chose this option for an SPI_DIO.
You can chose to have your board equipped with a male 10-pin connector that allows you to connect your board with the SPI_DIO or I2C DIO using a short 10pin IDC cable.
== Future hardware enhancements ==
may 2013: This is vaporware: hardware will be available june 2013.
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
abd8250165c7a86e17ab99ca66e37a42d3651cb9
Motordriver
0
1839
3745
2015-12-10T09:41:14Z
Cartridge1987
2553
Redirected page to [[Motor]]
wikitext
text/x-wiki
#REDIRECT [[Motor]]
7883954015c088600f1b3a6d2956e64a817f5910
Motor driver
0
1840
3746
2015-12-10T09:41:51Z
Cartridge1987
2553
Redirected page to [[Motor]]
wikitext
text/x-wiki
#REDIRECT [[Motor]]
7883954015c088600f1b3a6d2956e64a817f5910
RPi relay
0
1841
3747
2015-12-10T09:50:48Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Rpi relay
0
1842
3748
2015-12-10T09:55:00Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
I2C connector pinout
0
619
3749
1709
2015-12-10T10:12:43Z
Cartridge1987
2553
/* example connection to rpi_serial */
wikitext
text/x-wiki
For the interconnect between I2C masters and the I2C expansion boards BitWizard uses a 4-pin I2C cable.
The connector is laid out as follows:
{| border=1
! pin !! function !! remark
|-
| 1 || GND || Power Ground
|-
| 2 || SDA || Serial I2C Data
|-
| 3 || SCK || Serial I2C Clock
|-
| 4 || VCC || Power 5V.
|-
|}
== Connecting the BitWizard boards to an Arduino ==
{| border=1
! pin !! function !! arduino pin !! Arduino Mega
|-
| 1 || GND || GND || GND
|-
| 2 || SDA || A4 (Analog input 4) || Digital 20
|-
| 3 || SCK || A5 (analog input 5) || Digital 21
|-
| 4 || VCC || VCC || VCC
|-
|}
You could use other pins, but then you have to make a software I2C implementation. This is not too difficult, but might be neccesary if something else is already on the I2C pins.
== Example connection to rpi_serial ==
[[File:i2c_connection.jpg|none|thumb|600px|alt=i2c connection to RPi_serial|i2c_lcd connected to rpi_serial]]
2f0a4da76db34ffbfb8eeb405acf15d3f8b7ae77
7fets
0
1843
3751
2015-12-10T12:08:22Z
Cartridge1987
2553
Redirected page to [[7FETs]]
wikitext
text/x-wiki
#REDIRECT [[7FETs]]
d26a38ce65912955118c69ceb3a31313f9228f58
File:DIO breakout.jpg
6
1844
3752
2015-12-10T12:10:28Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:I2c connection.jpg
6
1040
3753
1707
2015-12-11T14:11:14Z
Sjoerd
2544
uploaded a new version of "[[File:I2c connection.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
3754
3753
2015-12-11T14:12:21Z
Sjoerd
2544
uploaded a new version of "[[File:I2c connection.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
3755
3754
2015-12-11T14:12:32Z
Sjoerd
2544
uploaded a new version of "[[File:I2c connection.jpg]]": Reverted to version as of 14:11, 11 December 2015
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
DIO Protocol
0
1845
3760
2015-12-14T13:19:23Z
Cartridge1987
2553
Redirected page to [[DIO protocol]]
wikitext
text/x-wiki
#REDIRECT [[DIO protocol]]
95b72ee0e75dc549ef82d5cbd2656db18168af8d
Blog 21
0
1846
3761
2015-12-14T14:56:44Z
Cartridge1987
2553
Created page with "This is used for both projects: Hardware used on Raspberry Pi: *[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]]) *[http://www.bitwizar..."
wikitext
text/x-wiki
This is used for both projects:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Getting the analog meters to work ==
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
If you are going to use a pin like pin 10(IO6).
With the value 40.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
== DIO Analog meter clock ==
== DIO Cooking timer ==
{| border=1
! Pin !! Function !! Value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
4a659cd069f674e51995c2f6016a58b0d63444e8
3762
3761
2015-12-14T15:23:13Z
Cartridge1987
2553
wikitext
text/x-wiki
This is used for both projects:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
If you are going to use a pin like pin 10(IO6).
With the value 40.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
=== Making the sticker ===
== DIO Analog meter clock ==
== DIO Cooking timer ==
{| border=1
! Pin !! Function !! Value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
3e32bbee06397cae3c6c208054a43ae02b8b4bc3
3763
3762
2015-12-14T15:38:03Z
Cartridge1987
2553
wikitext
text/x-wiki
This is used for both projects:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
=== Making the sticker ===
== DIO Analog meter clock ==
== DIO Cooking timer ==
{| border=1
! Pin !! Function !! Value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
072a38191b3eaff7612278b3e2a1edb4a8de6af7
3764
3763
2015-12-14T16:04:46Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
This is used for both projects:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternative current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
== DIO Analog meter - Cooking timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
997a37908f8dc69893ba6b7b4ccf03912f719ee0
3765
3764
2015-12-14T16:08:24Z
Cartridge1987
2553
/* Connecting the analog meters */
wikitext
text/x-wiki
== !BETA! ==
This is used for both projects:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
== DIO Analog meter - Cooking timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
81aaa716a06d14e1be29ebbd914e3e5fd00caf6e
3766
3765
2015-12-14T16:51:18Z
Cartridge1987
2553
/* DIO Analog meter - Cooking timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for both projects:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
7b6fc69205407648d2e8a0cd11704ee42c98aa7c
3767
3766
2015-12-14T16:51:44Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
9622350306df0111a0ff68d466fad0c91b0d91fa
3768
3767
2015-12-15T11:00:39Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
== DIO Analog meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
d1f1dd88d295a1f895bac55c4ceb06cd89bcec2a
3769
3768
2015-12-15T11:19:17Z
Cartridge1987
2553
/* DIO Analog meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
== DIO Analog meter - Timer ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
echo "$Length"
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
720f05937d0923a8b0636e8300effffbe62fc69a
3770
3769
2015-12-15T12:52:14Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
echo "$Length"
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
7e0748e6fb1f42c26b08505fee1a75dd74b88cf2
3771
3770
2015-12-15T12:53:37Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Two analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
echo "$Length"
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
cadbe0579449508fb6a28092593c00b365c5d0da
3772
3771
2015-12-15T13:06:19Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
echo "$Length"
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
36d55afdd025979bad6163d34f8b3e4b4fb8e400
3773
3772
2015-12-15T14:06:15Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
echo "$Length"
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
9a6e62578062c4e5cd3d99d28083b7d73d22001c
3774
3773
2015-12-15T14:35:02Z
Cartridge1987
2553
/* DIO Analog meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
In this script I made a minute timer. The analog meter will starts at maximum PWM and ends at zero.
You can make the timer less longer by changes the value or by changing the sleep time.
What an onexit does I already explained in my previous ''DIO analog meter - Clock'' project above.
But ewhat I added this time to the script is an mplayer file so that when the script is done a song gets played.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
In this if statement it looks if the values are both zero, if that is the case it will run the function onexit.
if [ "$Length" = "$Zero" ]; then
onexit
fi
Thanks to that a hexadecimal calculation can be made. Which is that the previous length will counted down by the given value.
That will then be saved in Length direction.
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
41b5e4000fc99678c867ea3893ff8578be2d4830
3775
3774
2015-12-15T14:42:02Z
Cartridge1987
2553
/* DIO Analog meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
In this script I made a minute timer. The analog meter will starts at maximum PWM and ends at zero.
You can make the timer less longer by changes the value or by changing the sleep time.
What an onexit does I already explained in my previous ''DIO analog meter - Clock'' project above.
But ewhat I added this time to the script is an mplayer file so that when the script is done a song gets played.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
In this if statement it looks if the values are both zero, if that is the case it will run the function onexit.
if [ "$Length" = "$Zero" ]; then
onexit
fi
The obase=16, makes that the output is in hexadecimals and ibase does that the input is read in hexadecimals.
Thanks to that a hexadecimal calculation can be made. Which is that the previous length will counted down by the given value.
That will then be saved in Length direction.
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
0c5874295a23b2754ad8fb7ddf836316c57efdda
3776
3775
2015-12-15T14:43:13Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
In this script I made a minute timer. The analog meter will starts at maximum PWM and ends at zero.
You can make the timer less longer by changes the value or by changing the sleep time.
What an onexit does I already explained in my previous ''DIO analog meter - Clock'' project above.
But ewhat I added this time to the script is an mplayer file so that when the script is done a song gets played.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
In this if statement it looks if the values are both zero, if that is the case it will run the function onexit.
if [ "$Length" = "$Zero" ]; then
onexit
fi
The obase=16, makes that the output is in hexadecimals and ibase does that the input is read in hexadecimals.
Thanks to that a hexadecimal calculation can be made. Which is that the previous length will counted down by the given value.
That will then be saved in Length direction.
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
6b6c72bad1395c7d3f2db623bb602320b6b5de16
3779
3776
2015-12-16T10:31:02Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Timer ==
In this script I made a minute timer. The analog meter will starts at maximum PWM and ends at zero.
You can make the timer less longer by changes the value or by changing the sleep time.
What an onexit does I already explained in my previous ''DIO analog meter - Clock'' project above.
But ewhat I added this time to the script is an mplayer file so that when the script is done a song gets played.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
In this if statement it looks if the values are both zero, if that is the case it will run the function onexit.
if [ "$Length" = "$Zero" ]; then
onexit
fi
The obase=16, makes that the output is in hexadecimals and ibase does that the input is read in hexadecimals.
Thanks to that a hexadecimal calculation can be made. Which is that the previous length will counted down by the given value.
That will then be saved in Length direction.
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Length="FF"
Value="11"
Zero="0"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
$DIO -W 50:$Length
if [ "$Length" = "$Zero" ]; then
onexit
fi
Length=`(echo obase=16; echo ibase=16; echo $Length - $Value) | bc`
$UI -W 11:00
$UI -t "Seconds: " $Length
sleep 4
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
49e25e64e22a288fd74f652041c54965fbc6de86
Blog list
0
1798
3777
3726
2015-12-15T14:47:25Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
[RP] = Raspberry Pi
[A] = Arduino
*[[Blog 01]] - [RP] Starting up the Raspberry Pi
*[[Blog 02]] - [RP] Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - [RP] !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - [RP] !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - [RP] !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - [RP] !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - [RP] !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - [RP] Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - [RP] Online weather station
*[[Blog 10]] - [RP] Pushbutton menu
*[[Blog 11]] - [RP] Turning off and on a lamp with crontab on special times
*[[Blog 12]] - [RP] Alarm Menu
*[[Blog 13]] - [RP] Scroll Menu
*[[Blog 14]] - [RP][A] BigRelay checker
*[[Blog 15]] - [RP][A] Basic stepper motor
*[[Blog 16]] - [RP] Working with two stepper motors.
*[[Blog 17]] - [RP] Making a 2 wheeled car ( Stepper Motor / electric wheel )
*[[Blog 18]] - [RP] Settings menu, where you can change the contrast, backlight and volume of your Raspberry pi.
*[[Blog 19]] - [A] Arduino double wheeled var versions ( Stepper motor / electric wheel )
*[[Blog 20]] - [A] !BETA! Explanation from the SPI and I2C example code
*[[Blog 21]] - [RP] Analog Meter Clock and timer
1dc9f6eb004e2617bf4cba14f1b75f0d83295532
File:HourClock.jpg
6
1847
3778
2015-12-16T09:30:45Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
RPi UI
0
1848
3780
2015-12-16T10:34:15Z
Cartridge1987
2553
Redirected page to [[User Interface]]
wikitext
text/x-wiki
#REDIRECT [[User Interface]]
f1d6d2fddcff7d8fc75bfafdedd561d882938fc8
Rpi ui
0
1849
3781
2015-12-16T10:34:35Z
Cartridge1987
2553
Redirected page to [[User Interface]]
wikitext
text/x-wiki
#REDIRECT [[User Interface]]
f1d6d2fddcff7d8fc75bfafdedd561d882938fc8
Blog 21
0
1846
3782
3779
2015-12-16T14:34:20Z
Cartridge1987
2553
/* DIO Analog meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
bc78c28068402ff300face0fba234aecba36456b
3783
3782
2015-12-16T14:50:54Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
a5116e61f3544bf785b084727fc4beed5cda0c25
3784
3783
2015-12-16T15:36:00Z
Cartridge1987
2553
/* DIO Analog meter - Adjustable Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run.
if [ "$Now" -ge "$End" ]; then
onexit
fi
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
bf1c3b36281df3f0f12bf636ab00ff47141b0913
3785
3784
2015-12-16T15:38:06Z
Cartridge1987
2553
/* DIO Analog meter - Adjustable Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
9f397e2a99282e0c335c6565471e79ccb7871f10
3786
3785
2015-12-16T15:59:01Z
Cartridge1987
2553
/* Change analog meter value through the command line */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
5022aaaa96109a2427f15352309ca3e91baaaf1f
3788
3786
2015-12-16T16:13:03Z
Cartridge1987
2553
/* DIO Analog meter - Adjustable Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
b0c851eb0a1cd7a475210fa792646d9d7d4ec71e
3789
3788
2015-12-16T16:15:07Z
Cartridge1987
2553
/* DIO Analog meter - Adjustable Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
Twelve="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
ad2e1fe243b39d16113b69aa4880e2f6b3362269
3790
3789
2015-12-16T16:18:50Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$Twelve" ]; then
Hour=$(( $Hour - $Twelve ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
b280e2f60db63160fc1d1a141124f4d276b8be28
3791
3790
2015-12-16T16:19:21Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
5726222fd05af82d3556de1d2783a07b5adf5503
3792
3791
2015-12-16T16:35:46Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
13e0ebfe57e824925d10115e78b8d7d7ec6af0a2
3793
3792
2015-12-16T16:54:46Z
Cartridge1987
2553
/* Connecting the analog meters */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program to make the lines an put the image in the background. So, I know where to put where.
I had of course had to resize some part. After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on the meter, so it is recommended to use a tweezers. ( Or something else where you can hold it good ) I used my fingers and that had the problem that my picture was not precisely placed.
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
c5e4e12449b1a0311b56074d4bdf553462639fde
3796
3793
2015-12-17T09:10:51Z
Cartridge1987
2553
/* Making the sticker */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered the problem. That I had one Alternating current voltage. For this I had to
// blabla
checked it out by putting the power resource after the diode.
To check the analog meter I connected it with a power resource to find out if at which voltage it went to it's maximum.
Fast I found out that It went to it's maximum. To change that it went so fast to it's maximum I added two resistors.
And removed the connection with the normal resistor.
// blabla
To check if the meter you have work on the DIO.
Put the minus part of your meter on the GND(Pin 1), and the positive side on the VCC(Pin 2).
The pointer will directly go to it's to the right.
( If he doesn't you have to remove some resistors )
To connect the meters on the DIO:
I did my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which pin is what.
=== Change analog meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value and that is one.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%. If you did the commands above you can keep changing values if you still use the same pin(s).
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program to make the lines an put the image in the background. So, I know where to put where.
I had of course had to resize some part. After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on the meter, so it is recommended to use a tweezers. ( Or something else where you can hold it good ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
76f5371e31ba6b4f0867adb29300f63f3584acc7
3797
3796
2015-12-17T10:12:38Z
Cartridge1987
2553
/* Connecting the analog meters */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I am going to make on the analog meter visible how late it it.
For now I only have one analoge meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 IO0, which makes the pointer go back to the left. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This obviously looks at which hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What then gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $Twelve.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will be 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
After that one the second row of the LCD display the value will be printed of the new hour ( if it is above 12 ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
f37f8d2c31087b4a97068f1df525b805f0753a57
3798
3797
2015-12-17T10:30:50Z
Cartridge1987
2553
/* DIO Analog meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I made it possible to show how late it is on the analog meter.
For now I only have one analog meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 (IO0), which makes the pointer go back to the left. It after that clears the screen. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This looks at what hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $MAX.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will become 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
On the second row of the LCD display the value will be printed of the new hour ( if it is above 12 o'clock value ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go from maximum PWM to zero. ( Pointer from right to left )
That you just use in the command line, with the given value after it. With the value you say how many seconds the script should be running.
So, if you give it the value 30 it should look like this:
./Scriptname 30
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
(Idea: You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The pwm value then gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
So the maximum value 255 would be FF.
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is. ( The user interface part can be removed if not needed )
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting passed the onexit function is going to run. Otherwise it will just sleep 1 second, and after that look again if it reached it's point yet.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
b0cd62b6357ab91fdbd80e42def34dcfa3b6409a
3799
3798
2015-12-17T10:45:46Z
Cartridge1987
2553
/* DIO Analog meter - Adjustable Timer */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I made it possible to show how late it is on the analog meter.
For now I only have one analog meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 (IO0), which makes the pointer go back to the left. It after that clears the screen. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This looks at what hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $MAX.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will become 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
On the second row of the LCD display the value will be printed of the new hour ( if it is above 12 o'clock value ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go form the right to left and after that the raspberry pi will play a song.
The time of how long the progress has to take can be given after the script name.
So, if you want the timer to take 30 seconds, it should look like this:
./"Scriptname" 30
The explanation of the script:
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
( You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list, and is used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The PWM value gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
(So for example, the maximum value 255 would be FF.)
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is.
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting reached or passed the onexit function is going to run.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
ca38df918150c3917c8db7c89fb0366a017faf80
3803
3799
2015-12-17T11:10:16Z
Cartridge1987
2553
/* Connecting the analog meters */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
[[File:DCDIO.jpg|none|300px]]
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I made it possible to show how late it is on the analog meter.
For now I only have one analog meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 (IO0), which makes the pointer go back to the left. It after that clears the screen. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This looks at what hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $MAX.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will become 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
On the second row of the LCD display the value will be printed of the new hour ( if it is above 12 o'clock value ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go form the right to left and after that the raspberry pi will play a song.
The time of how long the progress has to take can be given after the script name.
So, if you want the timer to take 30 seconds, it should look like this:
./"Scriptname" 30
The explanation of the script:
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
( You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list, and is used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The PWM value gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
(So for example, the maximum value 255 would be FF.)
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is.
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting reached or passed the onexit function is going to run.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
7c1148a452cf372177d05e7d582fbb6bb9332fa4
3804
3803
2015-12-17T11:48:26Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
[[File:DCDIO.jpg|none|300px]]
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I made it possible to show how late it is on the analog meter.
For now I only have one analog meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 (IO0), which makes the pointer go back to the left. It after that clears the screen. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This looks at what hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $MAX.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will become 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
On the second row of the LCD display the value will be printed of the new hour ( if it is above 12 o'clock value ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go form the right to left and after that the raspberry pi will play a song.
The time of how long the progress has to take can be given after the script name.
So, if you want the timer to take 30 seconds, it should look like this:
./"Scriptname" 30
The explanation of the script:
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
( You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list, and is used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The PWM value gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
(So for example, the maximum value 255 would be FF.)
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is.
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting reached or passed the onexit function is going to run.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
*[[Blog list]]
133b76ae3a2938d8a4ad2adabc0fa92d796709a9
3805
3804
2015-12-18T12:59:31Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
[[File:DCDIO.jpg|none|300px]]
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I made it possible to show how late it is on the analog meter.
For now I only have one analog meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 (IO0), which makes the pointer go back to the left. It after that clears the screen. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This looks at what hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $MAX.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will become 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
On the second row of the LCD display the value will be printed of the new hour ( if it is above 12 o'clock value ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go form the right to left and after that the raspberry pi will play a song.
The time of how long the progress has to take can be given after the script name.
So, if you want the timer to take 30 seconds, it should look like this:
./"Scriptname" 30
The explanation of the script:
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
( You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list, and is used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The PWM value gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
(So for example, the maximum value 255 would be FF.)
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is.
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting reached or passed the onexit function is going to run.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
*[[Blog list]]
3292a4219a3a4ce7cc6cf6acc8a9de8eb6011384
3807
3805
2015-12-18T13:10:18Z
Cartridge1987
2553
Undo revision 3805 by [[Special:Contributions/Cartridge1987|Cartridge1987]] ([[User talk:Cartridge1987|talk]])
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
[[File:DCDIO.jpg|none|300px]]
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I made it possible to show how late it is on the analog meter.
For now I only have one analog meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 (IO0), which makes the pointer go back to the left. It after that clears the screen. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This looks at what hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $MAX.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will become 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
On the second row of the LCD display the value will be printed of the new hour ( if it is above 12 o'clock value ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go form the right to left and after that the raspberry pi will play a song.
The time of how long the progress has to take can be given after the script name.
So, if you want the timer to take 30 seconds, it should look like this:
./"Scriptname" 30
The explanation of the script:
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
( You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list, and is used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The PWM value gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
(So for example, the maximum value 255 would be FF.)
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is.
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting reached or passed the onexit function is going to run.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
*[[Blog list]]
133b76ae3a2938d8a4ad2adabc0fa92d796709a9
Blog list
0
1798
3787
3777
2015-12-16T16:07:41Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
[RP] = Raspberry Pi
[A] = Arduino
*[[Blog 01]] - [RP] Starting up the Raspberry Pi
*[[Blog 02]] - [RP] Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - [RP] !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - [RP] !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - [RP] !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - [RP] !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - [RP] !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - [RP] Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - [RP] Online weather station
*[[Blog 10]] - [RP] Pushbutton menu
*[[Blog 11]] - [RP] Turning off and on a lamp with crontab on special times
*[[Blog 12]] - [RP] Alarm Menu
*[[Blog 13]] - [RP] Scroll Menu
*[[Blog 14]] - [RP][A] BigRelay checker
*[[Blog 15]] - [RP][A] Basic stepper motor
*[[Blog 16]] - [RP] Working with two stepper motors.
*[[Blog 17]] - [RP] Making a 2 wheeled car ( Stepper Motor / electric wheel )
*[[Blog 18]] - [RP] Settings menu, where you can change the contrast, backlight and volume of your Raspberry pi.
*[[Blog 19]] - [A] Arduino double wheeled var versions ( Stepper motor / electric wheel )
*[[Blog 20]] - [A] !BETA! Explanation from the SPI and I2C example code
*[[Blog 21]] - [RP] Analog Meter Clock and adjustable timer
1c001701667fef2e8c1d493f853b47deebf55eac
File:DClock.jpg
6
1850
3794
2015-12-17T09:08:08Z
Cartridge1987
2553
Made for [[Blog 21]]
wikitext
text/x-wiki
Made for [[Blog 21]]
2e99c277d8049f26e5c925c32624825683a6187c
3795
3794
2015-12-17T09:08:39Z
Cartridge1987
2553
wikitext
text/x-wiki
A DC Meter Clock Made for [[Blog 21]]
ffe195b3f5f7a7870611ead66026deeeaa684c12
File:DCDIO.jpg
6
1851
3800
2015-12-17T11:06:54Z
Cartridge1987
2553
DC meter connected with the [[DIO]] and [[RPI ui]] for [[Blog 21]]
wikitext
text/x-wiki
DC meter connected with the [[DIO]] and [[RPI ui]] for [[Blog 21]]
50608f90ea366c5033031b82f7e9a69e342f7915
3801
3800
2015-12-17T11:07:29Z
Cartridge1987
2553
wikitext
text/x-wiki
DC meter connected with the [[DIO]] and [[RPI UI]] for [[Blog 21]]
c91473d19ec9bdaf13e62ace12a79851b97e88c8
3802
3801
2015-12-17T11:07:55Z
Cartridge1987
2553
wikitext
text/x-wiki
DC meter connected with the [[DIO]] and [[Rpi ui]] for [[Blog 21]]
bc6426b259e25b104ce3969bec97120541b11a23
Blog 22
0
1852
3806
2015-12-18T13:09:00Z
Cartridge1987
2553
Created page with " == !BETA! == Hardware used on Arduino: *[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]]) *[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-..."
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
c22662656cc2df4bc47f8ff63c78f7255df1d9a6
USB-multio
0
46
3808
3576
2015-12-18T14:16:47Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:USBio_top.jpg|thumb|300px|alt=The USB Multio|The USB Multio]]
This is the documentation page for the USB-Multio PCB.
That can be bought in the [http://www.bitwizard.nl/shop/avr-boards/usb-multio-21 BitWizard shop].
== Overview ==
The USB-Multio PCB has an USB connector and a 20-pin IO connector. The brains of the PCB is an at90usb162 (or compatible) chip.<br>
== Assembly instructions ==
The USB-Multio PCB can be configured in multiple ways, depending on the application. A variety of is included, to suit most needs.<br>
=== Possible configurations ===
==== Directly plugged into breadboard ====
Solder the golden, round headers on the outer two rows of holes. Don't use regular headers, they will ruin your breadboard!<br>
We prefer so let these pins stick down, so the board is mounted om the breadboard, with the microcontroller visible. It is of course possible to mount the pins on the other side, but mounting the SPI/ISP or RESET header, would then make it impossible to plug the multio into a breadboard.
[[File:USBio_bottom.jpg|400px|none]]
==== Connected with 20p ribbon cable ====
Solder the 2x10 header in the middle of the 4x10 hole array, on the same side as all the other components. If you solder the header on the other side, the pin numbering as listed below will no longer be correct. On the other hand, if you have a similar board with 2x10 female connectors on top, you'd be able to plug it into that other board just like that!
[[File:USBio_top.jpg|400px|none]]
==== Connected to RGB_clock PCB ====
Solder the two female header strips on the bottom side of the PCB, in the middle of the 4x10 hole array.
[[File:USBio_clock.jpg|400px|none]]
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf AT90USB162 datasheet]
* [http://atmel.com/dyn/resources/prod_documents/doc7799.pdf ATmega8/16/32U2 datasheet]
== Additional software ==
For software development, implmenting USB communication we recommend LUFA:
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
* [[RGB_clock]]
=== Example projects ===
* [[Usbio_kitt]]
* [[Usbio_ACM_sample_program]]
== Pinout ==
The 20 pin connector is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PD1 (AIN0 / INT1)</td></tr>
<tr><td>4</td><td>PD2 (AIN1 / RXD1 / INT2)</td></tr>
<tr><td>5</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>6</td><td>PD4 (INT5)</td></tr>
<tr><td>7</td><td>PD5 (XCK1 / PCINT12)</td></tr>
<tr><td>8</td><td>PD6 (/RTS / INT6)</td></tr>
<tr><td>9</td><td>PB1 (SCLK / PCINT1)</td></tr>
<tr><td>10</td><td>PB0 (/SS / PCINT0)</td></tr>
<tr><td>11</td><td>PB3 (PDO / MISO / PCINT3)</td></tr>
<tr><td>12</td><td>PB2 (PDI / MOSI / PCINT2)</td></tr>
<tr><td>13</td><td>PB5 (PCINT5)</td></tr>
<tr><td>14</td><td>PB4 (T1 / PCINT4)</td></tr>
<tr><td>15</td><td>PB7 (OC0A / OC1C / PCINT7)</td></tr>
<tr><td>16</td><td>PB6 (PCINT6)</td></tr>
<tr><td>17</td><td>PC6 (OC1A / PCINT8)</td></tr>
<tr><td>18</td><td>PC7 (ICP1 / INT4 / CLKO)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* rx PC5
* tx PC4
JP1 is connected in parallel with the reset button, to provide an external reset header.
PC4 and PC5 are also brought out to solder pads, next to the 20-pin connector.
=== LEDs ===
==== Version 2.1 ====
* led1 is connected to VCC
* led2 is connected to PD0
* led3 is connected to PC2
* led12 is connected to PD7
==== Version 2.0 ====
* led1 (near the bottom) is connected to PC2
* led2 (near the AVR) is connected to PD0.
== Jumper settings ==
==== Version 2.1 ====
<table border=1>
<tr><td></td><td>SJ1</td><td>SJ2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.
JMP1: ICSP-Enable. CAUTION! Pin 1 and 2 are connected by a narrow PCB track. Cut this if you want to change this jumper setting.<br>
1-2: Default: SS connected to pin PB0 (MCU can function as an SPI slave or master, or as an ICSP programmer)<br>
2-3: ICSP enabled, SS connected to reset (programming the MCU over the 6-pin connector is enabled)<br>
== Use as a programmer ==
The usb-multio can be used as a programmer for ICSP programming other Atmel processors.
For this you need the AVRISP software from http://www.fourwalledcubicle.com/AVRISP.php
This has not been tested yet.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
If you prefer a commandline tool, Atmel provides a program called BATCHISP.EXE that comes with the FLIP package.
== Writing programs ==
The chip is an at90usb162. http://www.atmel.com/dyn/resources/prod_documents/doc7707.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Physical dimensions ==
=== 2.1 ===
Board outline: 50x34 mm(1.97x1.32 inch)
=== 2.0 ===
== Future hardware enhancements ==
* Make sure that all pins with special functions are exported to the connector.
* Make a header for all pins not provided on the external connector.
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 2.1 ===
* Removed row of 8 resistors + LEDs
* Added ICSP connector
* Added jumper for external reset
* Added possibility to mount connector, to directly plug the board into a breadboard.
* Added pads for PC4 and PC5
* Connected extra LED to PD7
=== 2.0 ===
* Initial public release
0c4b220914645a8113b7b907ff7aae51ac43a21e
Raspberry Pi Camera extension kit
0
1853
3809
2015-12-21T09:32:25Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi camera extension kit]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi camera extension kit]]
f2612e18bb7cd4b5276f89aaca381eec3822d164
RPi Camera
0
1854
3810
2015-12-21T09:33:30Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi camera extension kit]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi camera extension kit]]
f2612e18bb7cd4b5276f89aaca381eec3822d164
RPi Camera Extension kit
0
1855
3811
2015-12-21T09:34:02Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi camera extension kit]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi camera extension kit]]
f2612e18bb7cd4b5276f89aaca381eec3822d164
Rpi camera extension kit
0
1856
3812
2015-12-21T09:34:22Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi camera extension kit]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi camera extension kit]]
f2612e18bb7cd4b5276f89aaca381eec3822d164
Camera board
0
1857
3813
2015-12-21T09:35:19Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi camera extension kit]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi camera extension kit]]
f2612e18bb7cd4b5276f89aaca381eec3822d164
Raspberry pi camera board
0
1858
3814
2015-12-21T09:35:37Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi camera extension kit]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi camera extension kit]]
f2612e18bb7cd4b5276f89aaca381eec3822d164
Raspberry Pi Serial BoB
0
1859
3815
2015-12-21T09:38:12Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi Serial]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi Serial]]
9881657fc184107d60470cde3741f746132301eb
Raspberry Pi Serial bob
0
1860
3816
2015-12-21T09:39:50Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi Serial]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi Serial]]
9881657fc184107d60470cde3741f746132301eb
Raspberry pi serial bob
0
1861
3817
2015-12-21T09:40:04Z
Cartridge1987
2553
Redirected page to [[Raspberry Pi Serial]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Pi Serial]]
9881657fc184107d60470cde3741f746132301eb
RPi relay 2.0
0
1862
3818
2015-12-21T09:42:55Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Rpi relay 2.0
0
1863
3819
2015-12-21T09:43:24Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Raspberry Solid State Relay
0
1864
3820
2015-12-21T09:44:30Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Rpi SSR
0
1865
3821
2015-12-21T09:45:21Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
RPi SSR
0
1866
3822
2015-12-21T09:45:33Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Rpi SSR 2.0
0
1867
3823
2015-12-21T09:45:48Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
RPi SSR 2.0
0
1868
3824
2015-12-21T09:46:01Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
RPi ssr
0
1869
3825
2015-12-21T09:47:02Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Raspberry SPI Relay
0
1870
3826
2015-12-21T09:48:00Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Raspberry spi relay
0
1871
3827
2015-12-21T09:48:13Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Raspberry pi SPI relay
0
1872
3828
2015-12-21T09:48:42Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
RPi spi relay
0
1873
3829
2015-12-21T09:49:57Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Rpi spi relay
0
1874
3830
2015-12-21T09:50:12Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
RPi spi relay 2.0
0
1875
3831
2015-12-21T09:50:48Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Rpi spi relay 2.0
0
1876
3832
2015-12-21T09:51:06Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Relay]]
5e49d20f314ef471cdb5e1e260e1793e0fa0f78e
Dio protocol
0
1877
3833
2015-12-21T09:56:15Z
Cartridge1987
2553
Redirected page to [[DIO protocol]]
wikitext
text/x-wiki
#REDIRECT [[DIO protocol]]
95b72ee0e75dc549ef82d5cbd2656db18168af8d
Dio Protocol
0
1878
3834
2015-12-21T09:57:09Z
Cartridge1987
2553
Redirected page to [[DIO protocol]]
wikitext
text/x-wiki
#REDIRECT [[DIO protocol]]
95b72ee0e75dc549ef82d5cbd2656db18168af8d
3fets
0
1879
3835
2015-12-21T13:39:17Z
Cartridge1987
2553
Redirected page to [[3FETs]]
wikitext
text/x-wiki
#REDIRECT [[3FETs]]
b3634a98553ca548a8049bf27ad284bbad1c619f
3 fets
0
1880
3836
2015-12-21T13:39:53Z
Cartridge1987
2553
Redirected page to [[3FETs]]
wikitext
text/x-wiki
#REDIRECT [[3FETs]]
b3634a98553ca548a8049bf27ad284bbad1c619f
7 fets
0
1881
3837
2015-12-21T13:41:14Z
Cartridge1987
2553
Redirected page to [[7FETs]]
wikitext
text/x-wiki
#REDIRECT [[7FETs]]
d26a38ce65912955118c69ceb3a31313f9228f58
Tw bigrelay
0
1882
3838
2015-12-21T13:49:25Z
Cartridge1987
2553
Redirected page to [[BigRelay]]
wikitext
text/x-wiki
#REDIRECT [[BigRelay]]
be15c8b4e3068df0f3f08fde1d2b62c23dd0ba5d
3839
3838
2015-12-21T13:49:34Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
BigRelay
0
1883
3840
2015-12-21T13:50:26Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
Bigrelay
0
1884
3841
2015-12-21T13:50:42Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
Big relay
0
1885
3842
2015-12-21T13:51:28Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
I2c dio
0
1886
3843
2015-12-21T13:55:51Z
Cartridge1987
2553
Redirected page to [[DIO]]
wikitext
text/x-wiki
#REDIRECT [[DIO]]
bf37aff6978dac1a171bac9af0b1d5f6a314d23e
I2c rtc
0
1887
3844
2015-12-21T14:04:46Z
Cartridge1987
2553
Redirected page to [[Rtc]]
wikitext
text/x-wiki
#REDIRECT [[rtc]]
4a1f19ac3185c30665d7a3e9e753b11114cfbf7d
Splitter
0
1888
3845
2015-12-21T14:07:49Z
Cartridge1987
2553
Redirected page to [[I2c splitter]]
wikitext
text/x-wiki
#REDIRECT [[i2c splitter]]
353580058a782f555d06c7bde4c64debc1bea6e2
3846
3845
2015-12-21T14:08:06Z
Cartridge1987
2553
Redirected page to [[I2C splitter]]
wikitext
text/x-wiki
#REDIRECT [[I2C splitter]]
de68bda70434eea8dd365251e612add2e3a55aa3
I2c raspberry juice
0
1889
3847
2015-12-21T14:21:14Z
Cartridge1987
2553
Redirected page to [[Raspberry Juice]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Juice]]
16297a7189e421f5f2704a357a5b576289f72685
Spi raspberry juice
0
1890
3848
2015-12-21T14:21:43Z
Cartridge1987
2553
Redirected page to [[Raspberry juice]]
wikitext
text/x-wiki
#REDIRECT [[raspberry juice]]
13ec0b47171130b2722f0fe8e3091840acc54de5
3849
3848
2015-12-21T14:23:04Z
Cartridge1987
2553
Redirected page to [[Raspberry Juice]]
wikitext
text/x-wiki
#REDIRECT [[Raspberry Juice]]
16297a7189e421f5f2704a357a5b576289f72685
I2c rpi ui
0
1891
3850
2015-12-21T14:25:28Z
Cartridge1987
2553
Redirected page to [[User Interface]]
wikitext
text/x-wiki
#REDIRECT [[User Interface]]
f1d6d2fddcff7d8fc75bfafdedd561d882938fc8
Spi rpi ui
0
1892
3851
2015-12-21T14:25:58Z
Cartridge1987
2553
Redirected page to [[User Interface]]
wikitext
text/x-wiki
#REDIRECT [[User Interface]]
f1d6d2fddcff7d8fc75bfafdedd561d882938fc8
Spi relay
0
1893
3852
2015-12-21T14:28:32Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
I2c relay
0
1894
3853
2015-12-21T14:28:43Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
I2c bigrelay
0
1895
3854
2015-12-21T14:29:07Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
Spi bigrelay
0
1896
3855
2015-12-21T14:29:18Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT [[Relay]]
d3bd560c30d67ce2ff483f3e2d61eff000ef9056
I2c servo
0
1897
3856
2015-12-21T14:31:12Z
Cartridge1987
2553
Redirected page to [[Servo]]
wikitext
text/x-wiki
#REDIRECT [[Servo]]
91a2efa2681c79229d8ae17fbe09ea0eb6a1280b
I2c temp
0
1898
3857
2015-12-21T14:34:43Z
Cartridge1987
2553
Redirected page to [[Temperature Interface]]
wikitext
text/x-wiki
#REDIRECT [[Temperature Interface]]
ba78870303c9be3f137627816b0b929931db15b6
Spi temp
0
1899
3858
2015-12-21T14:35:07Z
Cartridge1987
2553
Redirected page to [[Temperature Interface]]
wikitext
text/x-wiki
#REDIRECT [[Temperature Interface]]
ba78870303c9be3f137627816b0b929931db15b6
Ftdi atmega
0
1900
3859
2015-12-21T14:41:36Z
Cartridge1987
2553
Redirected page to [[FTDI ATmega]]
wikitext
text/x-wiki
#REDIRECT [[FTDI ATmega]]
db491020936f5a0aae7302d2f34819424606e7f8
USB BigMultio
0
1901
3860
2015-12-21T14:45:45Z
Cartridge1987
2553
Redirected page to [[Usbbigmultio]]
wikitext
text/x-wiki
#REDIRECT [[Usbbigmultio]]
1c2058205f4a5ece4135108414b4beddb55cfca6
Usb bigmultio
0
1902
3861
2015-12-21T14:46:15Z
Cartridge1987
2553
Redirected page to [[Usbbigmultio]]
wikitext
text/x-wiki
#REDIRECT [[Usbbigmultio]]
1c2058205f4a5ece4135108414b4beddb55cfca6
Usbbigmultio
0
5
3862
3512
2015-12-21T14:48:16Z
Cartridge1987
2553
wikitext
text/x-wiki
= USB IO =
This is the documentation page for the USB bigmultio PCB.
The USB bigMultio PCB can be bought in the [http://www.bitwizard.nl/shop/avr-boards/usb-bigmultio BitWizard shop].
== Overview ==
The USBbigmultio PCB has an USB connector and two 20-pin IO connectors. The brains of the PCB is an ATmega32U4 chip.
== Assembly instructions ==
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf ATmega16/32U4 datasheet]
== Additional software ==
* [http://www.fourwalledcubicle.com/LUFA.php LUFA, a open-source USB framework]
=== Related projects ===
== Pinout ==
20 Pin connector SV1 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PB0 (SS / PCINT0)</td></tr>
<tr><td>4</td><td>PB1 (PCINT1 / SCLK)</td></tr>
<tr><td>5</td><td>PB2 (PDI / PCINT2 / MOSI)</td></tr>
<tr><td>6</td><td>PB3 (PDO / PCINT3 / MISO)</td></tr>
<tr><td>7</td><td>PB4 (PCINT4 / ADC11)</td></tr>
<tr><td>8</td><td>PB5 (PCINT5 / OC1A / /OC4B / ADC12)</td></tr>
<tr><td>9</td><td>PB6 (PCINT6 / OC1B / OC4B / ADC13)</td></tr>
<tr><td>10</td><td>PB7 (PCINT7 / OC0A / OC1C / /RTS)</td></tr>
<tr><td>11</td><td>PD0 (OC0B / SCL / INT0)</td></tr>
<tr><td>12</td><td>PD1 (SDA / INT1)</td></tr>
<tr><td>13</td><td>PD2 (RXD1 / INT2)</td></tr>
<tr><td>14</td><td>PD3 (TXD1 / INT3)</td></tr>
<tr><td>15</td><td>PD4 (ICP1 / ADC8)</td></tr>
<tr><td>16</td><td>PD5 (XCK1 / /CTS)</td></tr>
<tr><td>17</td><td>PD6 (T1 / /OC4D / ADC9)</td></tr>
<tr><td>18</td><td>PD7 (T0 / OC4D / ADC10)</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
20 Pin connector SV2 is connected as follows
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>GND</td></tr>
<tr><td>3</td><td>PC6 (OC3A / /OC4A)</td></tr>
<tr><td>4</td><td>PC7 (ICP3 / CLK0 / OC4A)</td></tr>
<tr><td>5</td><td>PE2 (/HWB)</td></tr>
<tr><td>6</td><td>PE6 (INT6 / AIN0)</td></tr>
<tr><td>7</td><td>PF0 (ADC0)</td></tr>
<tr><td>8</td><td>PF1 (ADC1)</td></tr>
<tr><td>9</td><td>PF4 (ADC4 / TCK)</td></tr>
<tr><td>10</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>11</td><td>PF6 (ADC6 / TDO)</td></tr>
<tr><td>12</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>13</td><td>PF1 (ADC1)</td></tr>
<tr><td>14</td><td>NC</td></tr>
<tr><td>15</td><td>PF5 (ADC5 / TMS)</td></tr>
<tr><td>16</td><td>NC</td></tr>
<tr><td>17</td><td>PF7 (ADC7 / TDI)</td></tr>
<tr><td>18</td><td>AREF</td></tr>
<tr><td>19</td><td>VCC</td></tr>
<tr><td>20</td><td>VCC</td></tr>
</table>
* led1 is connected to VCC
* led2 is connected to PF6
* led3 is connected to PF7
* led4 is connected to PE2
== Jumper settings ==
<table border=1>
<tr><td></td><td>J1</td><td>J2</td><td>IC1</td></tr>
<tr><td>5V</td><td>1</td><td>0</td><td>NOT mounted</td></tr>
<tr><td>3V3 <50mA</td><td>0</td><td>1</td><td>NOT mounted</td></tr>
<tr><td>3V3 >50mA</td><td>0</td><td>0</td><td>mounted</td></tr>
</table>
0 Means open, 1 means bridged.<br>
3V3 operation is not supported, but may or may not work in your application.
== Programming ==
This section describes how you get your program into the processor.
In general what you need to know is that the processor will boot into the code you programmed into it on powerup. Once you're done developing your program, that's the way you'll use it: Powerup, run.
If there is no program loaded or if you press the reset button the chip comes up in "firmware upload mode". This is done by a bootloader. You should take care not to overwrite or erase the bootloader, because there is no way to put the bootloader back once it is gone.
=== Linux ===
Get the dfu-programmer for atmel chips package. (link?)
On sufficiently recent Ubunu distributions that is as simple as:
sudo apt-get install dfu-programmer
I recommend creating a script called "dfu":
#!/bin/sh
if [ -z "$CHIP" ] ; then
chip=at90usb162
else
chip=$CHIP
fi
hex=$1
sudo dfu-programmer $chip erase
sudo dfu-programmer $chip flash --suppress-bootloader-mem $hex
sudo dfu-programmer $chip start
TODO: figure out how to get rid of the "sudo" commands here...
Now downloading and starting a program is as simple as pressing the reset button and then:
dfu <yourbinary>.hex
TODO: When I'm developing, I'm likely to modify the code, and when I want to program the chip I hit the "reset" button on the board. Then the computer will see my chip re-enumerate as the Atmel DFU chip. A simple script could watchout for that and invoke dfu <mycurrentbinary>.hex the moment the chip has enumerated. Once that's running downloading and starting the latest code becomes as simple as hitting the reset button.
Apparently the FLIP program is now available for Linux too. See below.
=== Windows ===
Get the "flip" program from Atmel. http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886
== Writing programs ==
The chip is an ATmega32U4. http://www.atmel.com/dyn/resources/prod_documents/doc7766.pdf
You can program the processor as if it is a normal AVR processor without USB. Just like an arduino. Or you can program it to have USB support. For this the LUFA package is very useful. http://www.fourwalledcubicle.com/LUFA.php
Depending on what you want you can start from these examples:
* [[usbio kitt]]
* [[usbio ACM sample program]].
DONE: Find out if we can jump to the bootloader from our code so that we can issue a "go get yourself updated" command over the USB (yes, but the documentation says nothing about what address to jump to). This comes in handy if the reset button is difficult to reach because the device is built-in somewhere. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf
== Future hardware enhancements ==
* Make an I2C header
== Future software enhancements ==
* program the LUFA bootloader.
* Program an even smaller bootloader. (512 bytes should be possible, CF teensy/halfkay).
== Changelog ==
=== 1.1 ===
* Added ICSP connector (can function as ISP slave, master, or SPI connector)
* Added header parallel to reset switch
=== 1.0 ===
* Initial release
64a885374ae08c8a340290b2d1f7a910323dc2eb
USB-multio-2.1
0
1903
3863
2015-12-21T14:51:04Z
Cartridge1987
2553
Redirected page to [[USB-multio]]
wikitext
text/x-wiki
#REDIRECT [[USB-multio]]
0775cf9ff5abe6475396a0955817a5ed7c21cc9b
Usb multio
0
1904
3864
2015-12-21T14:52:21Z
Cartridge1987
2553
Redirected page to [[USB-multio]]
wikitext
text/x-wiki
#REDIRECT [[USB-multio]]
0775cf9ff5abe6475396a0955817a5ed7c21cc9b
Usb-multio-2.1
0
1905
3865
2015-12-21T15:06:53Z
Cartridge1987
2553
Redirected page to [[USB-multio]]
wikitext
text/x-wiki
#REDIRECT [[USB-multio]]
0775cf9ff5abe6475396a0955817a5ed7c21cc9b
Usb multio 2.1
0
1906
3866
2015-12-21T15:07:50Z
Cartridge1987
2553
Redirected page to [[USB-multio]]
wikitext
text/x-wiki
#REDIRECT [[USB-multio]]
0775cf9ff5abe6475396a0955817a5ed7c21cc9b
Usb big multio
0
1907
3867
2015-12-23T08:48:38Z
Cartridge1987
2553
Redirected page to [[Usbbigmultio]]
wikitext
text/x-wiki
#REDIRECT [[usbbigmultio]]
e781eaf5fefaef4bbc2f3ad18934a0eed0285000
Usbbig multio
0
1908
3868
2015-12-23T08:51:06Z
Cartridge1987
2553
Redirected page to [[Usbbigmultio]]
wikitext
text/x-wiki
#REDIRECT [[usbbigmultio]]
e781eaf5fefaef4bbc2f3ad18934a0eed0285000
Usb-ws2812
0
1909
3869
2015-12-23T09:05:21Z
Cartridge1987
2553
Redirected page to [[Usb ws2812]]
wikitext
text/x-wiki
#REDIRECT [[usb ws2812]]
dcbe8e39249e72f14f8578996990c5831506be38
FT245R BoB V1.5
0
1910
3870
2015-12-23T09:51:42Z
Cartridge1987
2553
Redirected page to [[FT245RL V1.5]]
wikitext
text/x-wiki
#REDIRECT [[FT245RL V1.5]]
ff493fd0310b2fdcabc0ac54a014aa07858351f6
FT245R BoB
0
1911
3871
2015-12-23T09:52:28Z
Cartridge1987
2553
Redirected page to [[FT245RL V1.5]]
wikitext
text/x-wiki
#REDIRECT [[FT245RL V1.5]]
ff493fd0310b2fdcabc0ac54a014aa07858351f6
FT245R V1.5
0
1912
3872
2015-12-23T09:57:01Z
Cartridge1987
2553
Redirected page to [[FT245RL V1.5]]
wikitext
text/x-wiki
#REDIRECT [[FT245RL V1.5]]
ff493fd0310b2fdcabc0ac54a014aa07858351f6
Blog 22
0
1852
3873
3806
2015-12-23T12:31:51Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
== DIO Analog Meter - Clock ==
== DIO Analog Meter - Timer ==
== Useful links ==
[[Blog 21]] - The Raspberry Pi Version of the above projects.
673cb9d4c39636c0102bde651dd6a49f7cb7ccc4
3875
3873
2015-12-23T12:34:37Z
Cartridge1987
2553
/* Simple Example code */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
== DIO Analog Meter - Clock ==
== DIO Analog Meter - Timer ==
== Useful links ==
[[Blog 21]] - The Raspberry Pi Version of the above projects.
a4488423ab601c884d9129577eef4049845eab1b
3876
3875
2015-12-23T12:35:35Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
== DIO Analog Meter - Clock ==
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*[[Blog list]]
c015ed72fb0e400a831279a09a7093a3bde1d4f0
Blog 21
0
1846
3874
3807
2015-12-23T12:31:55Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
This is used for The project:
Hardware used on Raspberry Pi:
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-16x2 RPi_UI board] | ([[User Interface]])
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meters
Programmed with:
*Bash
*[[Bw tool]]
== Connecting the analog meters ==
While making the analog meter clock, I encountered a problem. That I had one Alternating current voltage.
So I had to make from the AC meter a DC meter.
For this I checked it out by putting the power resource after the diode.
When I connected the meter with a power resource, I directly found out it goes to fast to it's maximum.
To change that it went so fast to it's maximum I added two resistors. The DIO should give 5 volt.
To check if the meter you have work on the DIO.
Put the minus part of the meter on the GND(Pin 1), and the positive on the VCC(Pin 2).
The pointer from the meter will directly go to the right.
( If he doesn't you have to change resistors, or look if everything is well connected )
To connect the meter with the DIO:
I did in projects my positive cable on IO0, what is pin 3. ( The other cable has to go to GND Pin 1 )
On the wiki page of [[DIO]] you can see, which other pins are IO.
[[File:DCDIO.jpg|none|300px]]
=== Change meter value through the command line ===
Recommended to use the [[DIO protocol]].
I have in my example the analog meter connected with pin 3(IO0).
Pin 3 is IO0, so it will get the first value one.
If you are going to change from pin you have to do all three commands, otherwise you have to do the first two commands only once.
To set pin 3 as output:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:01
To enable the PWM:
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:01
To let the pointer go to 50% of the analog meter:
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
The value is in hexadecimals so that is why 80 is 50%.
If you are going to use a pin like pin 10(IO6).
With the value 40 for register 30 and 5f.
The reason it is 40 is, because the bits are in hexadecimals.
So, 64 decimal bits gets calculated to 40 hexadecimals.
The reason why this is getting used, is because it is bit masked. With that you can add multiple pins in the command.
So, if you you want pin 4(IO1) and pin 6(IO3) on:
IO1 + IO3 -> 02 + 08 = 0A
For the full Bit Mask list of values you have to go to the [[DIO protocol]]
=== Making the sticker ===
For making the sticker I first measured what the distance are from the the maximum and the minimum(0). I looked at the distance from horizontal and vertical.
After that I made a picture of the meter. I used the program xfig to make the lines and put the image in the background. So, I know what to put where.
After that I printed it out on a sticker paper, what I then put on my meter. It can be tricky work to do a sticker on a meter, so it is recommended to use tweezers. ( Or something else where you can hold it well with ) I used my fingers and that had the problem that my picture was not precisely placed.
[[File:DClock.jpg|none|300px]]
== DIO Analog meter - Clock ==
With this script, I made it possible to show how late it is on the analog meter.
For now I only have one analog meter that works, so I will only show how late it's in hours.
The script is pretty easy to understand, but I will still give some parts explanation.
This is the onexit script, What it does is when the script crashes or this function get named by the script. I will do the given commands and then exit the running script.
So, in my case it turns the PWM back to zero on pin 3 (IO0), which makes the pointer go back to the left. It after that clears the screen. If you use a different Pin and don't know which one to use you have to look at
the [[DIO Protocol]] page.
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
This looks at what hour it's and puts it in the directory name Hour.
Hour=`date +%H`
What gets printed on the display.
$UI -t "Clock=" $Hour
The if statement looks at which hour there is given and looks if it is greater than the given value in $MAX.
If it is 12 o’clock or later it will subtract 12 of it.
So, for example 18 will become 6.
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
In the Array stands the amount of steps with the value it should give in hexadecimals.
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FF )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
On the second row of the LCD display the value will be printed of the new hour ( if it is above 12 o'clock value ) and the hexadecimal value in the array.
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="12"
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
exit
}
while true; do
Hour=`date +%H`
# Hour=$((Hour + 6)) #I made this at 12:00, so I added 6 so I can see if the meter works
$UI -W 10:00
$UI -t "Clock=" $Hour
if [ "$Hour" -gt "$MAX" ]; then
Hour=$(( $Hour - $MAX ))
fi
array=( 00 17 2E 45 5C 73 8A A1 B8 CF E6 FD )
# Element 0 1 2 3 4 5 6 7 8 9 10 11
$UI -W 11:20
$UI -t "Hour=$Hour Array="${array[$Hour]}
$DIO -W 50:${array[$Hour]}
sleep 5
done
[[File:HourClock.jpg|400px|thumb|none|]]
== DIO Analog meter - Adjustable Timer ==
In this script I made an adjustable timer. That will let the meter go form the right to left and after that the raspberry pi will play a song.
The time of how long the progress has to take can be given after the script name.
So, if you want the timer to take 30 seconds, it should look like this:
./"Scriptname" 30
The explanation of the script:
Here it will give the amount of seconds the date program knows and give it to the variable Start.
The variable Seconds will get the value put after the script name (as in the example above with the value 30 )
( You can also change the Seconds value "$1" with the amount of seconds you want. )
The end variable counts the seconds and start variable together. I use this later in the script, so that it then knows when it reached it's maximum value.
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
The now variable gets in the while true list, and is used to read every time to look at which second it is now.
In progress the end(where the time ends) and now get counted of each other.
The PWM value gets calculated. What gives the percentage of 255 is used.
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
Here is gives the hexadecimal output of the PWMValue.
(So for example, the maximum value 255 would be FF.)
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
Here the the result gets send to the DIO and to the user interface. What makes that the analog meter is going to move and that on the display is visible what hexadecimal value it is.
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
In the onexit it looks if the now value has gotten equal of higher then the given end value, where it should have stopped. When the end value is getting reached or passed the onexit function is going to run.
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
The full script:
#!/bin/bash
DIO="bw_tool -I -D /dev/i2c-1 -a 84"
UI="bw_tool -I -D /dev/i2c-1 -a 94"
MAX="255"
Start=`date +%s`
Seconds="$1"
End=$(($Seconds + $Start))
trap onexit 1 2 3 15 ERR
function onexit() {
$DIO -W 50:00 #Turns PWM back to zero
$UI -W 10:00 #Clears screen
#mplayer Song.mp3
exit
}
while true; do
Now=`date +%s`
Progress=$(($End - $Now))
PWMValue=$(($Progress * $MAX / $Seconds))
PWMValueHex=`(echo obase=16; echo $PWMValue ) | bc`
$DIO -W 50:$PWMValueHex
$UI -W 11:20
$UI -t "Hex Value: " $PWMValueHex
if [ "$Now" -ge "$End" ]; then
onexit
fi
sleep 1
done
onexit
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[User Interface]]
*[[Blog 22]] - The Arduino version of the above projects.
*[[Blog list]]
fee0742a3d2240d10636dcd78229c6e0909236c9
Blog list
0
1798
3877
3787
2015-12-23T12:37:19Z
Cartridge1987
2553
wikitext
text/x-wiki
This is the list of all the blog projects uploaded on the BitWizard wiki.
[RP] = Raspberry Pi
[A] = Arduino
*[[Blog 01]] - [RP] Starting up the Raspberry Pi
*[[Blog 02]] - [RP] Turning on and off a lamp with a Raspberry Relay
*[[Blog 03]] - [RP] !BETA!Print text on a RPi_UI board (Raspberry User Interface)
*[[Blog 04]] - [RP] !BETA!Use the RPi_UI board as clock
*[[Blog 05]] - [RP] !BETA!Use the RPi_UI board to show the temperature
*[[Blog 06]] - [RP] !BETA!Make the RPi_UI board display the time and temperature
*[[Blog 07]] - [RP] !BETA!Use the push buttons of the RPi_UI board to print text on it
*[[Blog 08]] - [RP] Making the RPi_UI board display the Cpu & Gpu temperature
*[[Blog 09]] - [RP] Online weather station
*[[Blog 10]] - [RP] Pushbutton menu
*[[Blog 11]] - [RP] Turning off and on a lamp with crontab on special times
*[[Blog 12]] - [RP] Alarm Menu
*[[Blog 13]] - [RP] Scroll Menu
*[[Blog 14]] - [RP][A] BigRelay checker
*[[Blog 15]] - [RP][A] Basic stepper motor
*[[Blog 16]] - [RP] Working with two stepper motors.
*[[Blog 17]] - [RP] Making a 2 wheeled car ( Stepper Motor / electric wheel )
*[[Blog 18]] - [RP] Settings menu, where you can change the contrast, backlight and volume of your Raspberry pi.
*[[Blog 19]] - [A] Arduino double wheeled var versions ( Stepper motor / electric wheel )
*[[Blog 20]] - [A] !BETA! Explanation from the SPI and I2C example code
*[[Blog 21]] - [RP] Analog Meter Clock and adjustable timer
*[[Blog 22]] - [A] Analog Meter Clock and Timer
38eb6cf2c33507600a61cfa632a943426c8bfebe
ADC
0
1913
3878
2015-12-24T08:25:09Z
Cartridge1987
2553
Redirected page to [[I2C ADC]]
wikitext
text/x-wiki
#REDIRECT [[I2C ADC]]
a2b0ef07d1d1fa16a65c1800844b2bf372a217f2
SPI ADC
0
1914
3879
2015-12-24T08:29:22Z
Cartridge1987
2553
Redirected page to [[I2C ADC]]
wikitext
text/x-wiki
#REDIRECT [[I2C ADC]]
a2b0ef07d1d1fa16a65c1800844b2bf372a217f2
USB Optocoupler Control
0
1915
3880
2015-12-24T08:49:20Z
Cartridge1987
2553
Redirected page to [[USB Optocoupler Control]]
wikitext
text/x-wiki
#REDIRECT [[USB Optocoupler Control]]
d4f590f52ec1cdddfbabaedabb0e9bc7339593c8
3881
3880
2015-12-24T08:49:51Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
USB Optocoupler
0
1916
3882
2015-12-24T08:50:20Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
I2C magneto
0
1917
3883
2015-12-24T08:53:32Z
Cartridge1987
2553
Redirected page to [[I2C magnetometer]]
wikitext
text/x-wiki
#REDIRECT [[I2C magnetometer]]
aa92d891886b8921d2cea53278fbe30f1a7a9ead
I2C accel
0
1918
3884
2015-12-24T08:55:11Z
Cartridge1987
2553
Redirected page to [[I2C accellerometer]]
wikitext
text/x-wiki
#REDIRECT [[I2C accellerometer]]
50d8e4ddc8e415b3375c8a514898011fc3e41961
BW USB-reset-2.0
0
1919
3885
2015-12-24T08:58:56Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
Usb opto
0
1920
3886
2015-12-24T08:59:22Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
USB-reset
0
1921
3887
2015-12-24T09:00:44Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
BW USB-reset
0
1922
3888
2015-12-24T09:01:10Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
Bw usb reset
0
1923
3889
2015-12-24T09:01:48Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
Bw usb-reset
0
1924
3890
2015-12-24T09:02:16Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
Bw USB-reset-2.0
0
1925
3891
2015-12-24T09:03:05Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
Bw usb-reset-2.0
0
1926
3892
2015-12-24T09:03:30Z
Cartridge1987
2553
Redirected page to [[USB-opto]]
wikitext
text/x-wiki
#REDIRECT [[USB-opto]]
1c23c66712617ef1606fd738e4e04de8b16dd4e5
Ftdi serial
0
1927
3893
2015-12-24T09:06:35Z
Cartridge1987
2553
Redirected page to [[FTDI serial 2]]
wikitext
text/x-wiki
#REDIRECT [[FTDI serial 2]]
9232baeed94e75985c7b303c4e808ed027f08fa1
Ftdi serial 2
0
1928
3894
2015-12-24T09:07:35Z
Cartridge1987
2553
Redirected page to [[FTDI serial 2]]
wikitext
text/x-wiki
#REDIRECT [[FTDI serial 2]]
9232baeed94e75985c7b303c4e808ed027f08fa1
USB SATA POWER
0
1929
3895
2015-12-24T09:14:27Z
Cartridge1987
2553
Redirected page to [[USB-SATA powerswitch]]
wikitext
text/x-wiki
#REDIRECT [[USB-SATA powerswitch]]
1512d2853d10e776ed6ebf4d5c14a91e94a2430c
USB-SATA power
0
1930
3896
2015-12-24T09:15:13Z
Cartridge1987
2553
Redirected page to [[USB-SATA powerswitch]]
wikitext
text/x-wiki
#REDIRECT [[USB-SATA powerswitch]]
1512d2853d10e776ed6ebf4d5c14a91e94a2430c
USB-SATA POWER
0
1931
3897
2015-12-24T09:15:45Z
Cartridge1987
2553
Redirected page to [[USB-SATA powerswitch]]
wikitext
text/x-wiki
#REDIRECT [[USB-SATA powerswitch]]
1512d2853d10e776ed6ebf4d5c14a91e94a2430c
USB SATA POWER 1
0
1932
3898
2015-12-24T09:16:39Z
Cartridge1987
2553
Redirected page to [[USB-SATA powerswitch]]
wikitext
text/x-wiki
#REDIRECT [[USB-SATA powerswitch]]
1512d2853d10e776ed6ebf4d5c14a91e94a2430c
USB-relay
0
1933
3899
2015-12-24T09:20:41Z
Cartridge1987
2553
Redirected page to [[USB Relay]]
wikitext
text/x-wiki
#REDIRECT [[USB Relay]]
5ae9b87a5a31aa7c85bd4682bc323fcab38316e0
USB Relay Module
0
1934
3900
2015-12-24T09:21:26Z
Cartridge1987
2553
Redirected page to [[USB Relay]]
wikitext
text/x-wiki
#REDIRECT[[USB Relay ]]
98449ddeb7910e41628c9046a23da079280694e9
Usb relay
0
1935
3901
2015-12-24T09:22:12Z
Cartridge1987
2553
Redirected page to [[USB Relay]]
wikitext
text/x-wiki
#REDIRECT[[USB Relay]]
33bcb778db359bdb9252d7429be141eb22e82afd
Usb-relay
0
1936
3902
2015-12-24T09:22:35Z
Cartridge1987
2553
Redirected page to [[USB Relay]]
wikitext
text/x-wiki
#REDIRECT[[USB Relay]]
33bcb778db359bdb9252d7429be141eb22e82afd
RPi User Interface
0
1937
3903
2015-12-24T10:57:44Z
Cartridge1987
2553
Redirected page to [[User Interface]]
wikitext
text/x-wiki
#REDIRECT[[User Interface]]
48f25b75de3f8784cacea82449e880e5d9ee52aa
Rpi user interface
0
1938
3904
2015-12-24T10:58:25Z
Cartridge1987
2553
Redirected page to [[User Interface]]
wikitext
text/x-wiki
#REDIRECT[[User Interface]]
48f25b75de3f8784cacea82449e880e5d9ee52aa
Blog 22
0
1852
3905
3876
2015-12-24T14:22:53Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
== DIO Analog Meter - Clock ==
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*[https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ Guide from oopsohno: How to get the arduino time library up and going]
*[[Blog list]]
4f1da17365f3b2c97f338fd49c71eac62bbfc4a2
3906
3905
2015-12-24T14:26:27Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
== DIO Analog Meter - Clock ==
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
1693bfa8a158e86cf4afbfce5c61b6af22849385
3907
3906
2015-12-24T14:50:33Z
Cartridge1987
2553
/* DIO Analog Meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
dd14d81dac0b117de52a8ea14123185d29169b4e
3909
3907
2015-12-24T15:05:21Z
Cartridge1987
2553
/* Simple Example code */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
7a106da97377060fc9b5399d8e69a1fa221cd9f4
3910
3909
2015-12-24T16:06:47Z
Cartridge1987
2553
/* DIO Analog Meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
18fdf0eff395d6ca2ad0f835138eb2a286258c3a
3911
3910
2015-12-24T16:17:33Z
Cartridge1987
2553
/* DIO Analog Meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
d4dafae2299fe2682c2811c888563af44cd7d51e
3912
3911
2015-12-24T16:18:23Z
Cartridge1987
2553
/* DIO Analog Meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
b4e3e5782700be2545a76e6a6433eed3e01082f6
3913
3912
2015-12-28T11:06:11Z
Cartridge1987
2553
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
More information about the pin layout: [[DIO]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
dec87e4213b6fe77c53702f49ef01bced58a9c84
3914
3913
2015-12-28T11:44:03Z
Cartridge1987
2553
/* DIO Analog Meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
More information about the pin layout: [[DIO]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
4c76a669ea663b95428708f38cc3dd41d9dda346
3915
3914
2015-12-28T12:05:15Z
Cartridge1987
2553
/* DIO Analog Meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
More information about the pin layout: [[DIO]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
3ea4380ae9387147ea9629a11f2b75159013ce5b
3916
3915
2015-12-28T12:05:38Z
Cartridge1987
2553
/* DIO Analog Meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
More information about the pin layout: [[DIO]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
c1ed0cf022d3cbc8cdee47e8aa1b3312e3c74b26
3917
3916
2015-12-28T12:14:57Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
More information about the pin layout: [[DIO]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
0f484c5a8a1004c74857b98ae9bb6bd2717c4d70
3918
3917
2015-12-28T12:15:30Z
Cartridge1987
2553
/* Connection between DIO and analog meter */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
More information about the pin layout see: [[DIO]] * [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
1518b0c64ba478213e854ada7d6197dbf2de47fa
3919
3918
2015-12-28T12:15:43Z
Cartridge1987
2553
/* Connection between DIO and analog meter */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
More information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
9417f5bfb4eb6934c09953f6dd584b6b326bd8b8
3920
3919
2015-12-28T12:16:01Z
Cartridge1987
2553
/* Connection between DIO and analog meter */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
70cf9f4e3c280617a204548c6dca150eeda785cf
3921
3920
2015-12-28T12:22:09Z
Cartridge1987
2553
/* !BETA! */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Important stuff that is added:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
8f7e786c7e619bce1ad3b2c25ccecf90cd514ec3
3922
3921
2015-12-28T13:49:53Z
Cartridge1987
2553
/* DIO Analog Meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
e2b8a326b537b265dfdedb5a0c801da9142c492f
3923
3922
2015-12-28T14:22:39Z
Cartridge1987
2553
/* DIO Analog Meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
ddba68d871ec2ba8d87c130afc19d7b5415ccd07
3924
3923
2015-12-28T14:40:54Z
Cartridge1987
2553
/* DIO Analog Meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
Here in the loop part it will first look which second it is and give it to the variable CurrentSec.
byte CurrentSec = second();
The script will read the current sec and print it out on the serial monitor.
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
The progress gets calculated by looking what the endsec value is and counting of that the current second it is in now.
After that it prints in the serial monitor, how far the progress is.
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
The PWM value gets calculated by the given values given earlier and the progress that has been read.
After that the serial monitor will print the PWM value in hexadecimals.
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
The given hexadecimal PWM value, will then be send to the DIO.
set_var(0x42, 0x50, PwmValue);
Explanation from the arduino clock:
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
030c4b981a253afb99e9cab0d859a15fc6855544
3925
3924
2015-12-28T14:44:51Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
Here in the loop part it will first look which second it is and give it to the variable CurrentSec.
byte CurrentSec = second();
The script will read the current sec and print it out on the serial monitor.
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
The progress gets calculated by looking what the endsec value is and counting of that the current second it is in now.
After that it prints in the serial monitor, how far the progress is.
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
The PWM value gets calculated by the given values given earlier and the progress that has been read.
After that the serial monitor will print the PWM value in hexadecimals.
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
The given hexadecimal PWM value, will then be send to the DIO.
set_var(0x42, 0x50, PwmValue);
Explanation from the arduino clock:
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects + You can read how the background image is made.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
85fb389ce3592d4730ef10ca412282fcafc33a9a
3926
3925
2015-12-28T14:47:09Z
Cartridge1987
2553
/* DIO Analog Meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
Here in the loop part it will first look which second it is and give it to the variable CurrentSec.
byte CurrentSec = second();
The script will read the current sec and print it out on the serial monitor.
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
The progress gets calculated by looking what the endsec value is and counting of that the current second it is in now.
After that it prints in the serial monitor, how far the progress is.
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
The PWM value gets calculated by the given values given earlier and the progress that has been read.
After that the serial monitor will print the PWM value in hexadecimals.
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
The given hexadecimal PWM value, will then be send to the DIO.
set_var(0x42, 0x50, PwmValue);
Explanation from the arduino clock:
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects + You can read how the background image is made.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
8aa274d66856502e342f7a6e778c00b914287235
3927
3926
2015-12-28T14:58:00Z
Cartridge1987
2553
/* DIO Analog Meter - Clock */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
You also have to run the program [https://processing.org/ Processing] in my example, with the script SyncArduinoClock running, that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
Here in the loop part it will first look which second it is and give it to the variable CurrentSec.
byte CurrentSec = second();
The script will read the current sec and print it out on the serial monitor.
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
The progress gets calculated by looking what the endsec value is and counting of that the current second it is in now.
After that it prints in the serial monitor, how far the progress is.
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
The PWM value gets calculated by the given values given earlier and the progress that has been read.
After that the serial monitor will print the PWM value in hexadecimals.
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
The given hexadecimal PWM value, will then be send to the DIO.
set_var(0x42, 0x50, PwmValue);
Explanation from the arduino clock:
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects + You can read how the background image is made.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
5a21c50a604f26869caa78ad7f04c6d8dbb8efd1
3928
3927
2015-12-28T14:58:32Z
Cartridge1987
2553
/* DIO Analog Meter - Timer */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
You also have to run the program [https://processing.org/ Processing] in my example, with the script SyncArduinoClock running, that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino. You also have to run the program [https://processing.org/ Processing] in my example, with the script SyncArduinoClock running, that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
Here in the loop part it will first look which second it is and give it to the variable CurrentSec.
byte CurrentSec = second();
The script will read the current sec and print it out on the serial monitor.
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
The progress gets calculated by looking what the endsec value is and counting of that the current second it is in now.
After that it prints in the serial monitor, how far the progress is.
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
The PWM value gets calculated by the given values given earlier and the progress that has been read.
After that the serial monitor will print the PWM value in hexadecimals.
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
The given hexadecimal PWM value, will then be send to the DIO.
set_var(0x42, 0x50, PwmValue);
Explanation from the arduino clock:
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects + You can read how the background image is made.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[[Blog list]]
3f637e2c9eecca2367efb82bac69f5873c3d1812
3929
3928
2015-12-28T15:01:14Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
You also have to run the program [https://processing.org/ Processing] in my example, with the script SyncArduinoClock running, that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino. You also have to run the program [https://processing.org/ Processing] in my example, with the script SyncArduinoClock running, that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
Here in the loop part it will first look which second it is and give it to the variable CurrentSec.
byte CurrentSec = second();
The script will read the current sec and print it out on the serial monitor.
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
The progress gets calculated by looking what the endsec value is and counting of that the current second it is in now.
After that it prints in the serial monitor, how far the progress is.
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
The PWM value gets calculated by the given values given earlier and the progress that has been read.
After that the serial monitor will print the PWM value in hexadecimals.
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
The given hexadecimal PWM value, will then be send to the DIO.
set_var(0x42, 0x50, PwmValue);
Explanation from the arduino clock:
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects + You can read how the background image is made.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[https://processing.org/ Processing]
*[https://github.com/PaulStoffregen/Time Time Library]
*[[Blog list]]
5a0ea4771bc7d3f549225fe75e9c0baeea606275
3930
3929
2015-12-28T15:02:31Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== !BETA! ==
Hardware used on Arduino:
*[http://www.bitwizard.nl/shop/expansion-boards/dio DIO] | ([[DIO]])
*[http://www.bitwizard.nl/shop/cables-connectors/10-20cm-jumper-cables-m-f Jumper cables M-F]
*[http://www.bitwizard.nl/shop/cables-connectors/4-pin-cable-f-f 4 PIN I2C cable F-F]
*Analog meter
Programmed with:
*Arduino
*[https://github.com/PaulStoffregen/Time Time Library]
*[https://processing.org/ Processing]
== Connecting the analog meter ==
===Connection between DIO and Arduino:===
For this project I had the some what the same connection with my previous 7FETs Stepper Motor projects.
I put Jumper cables M-F on A4, A5, VCC and GND.
Those cables where connected through a 4 PIN I2C cable with the DIO.
The way they are connection is as followed:
{| border=1
! DIO PIN !! ARDUINO PIN
|-
| 1(White) || GND
|-
| 2 || A4
|-
| 3 || A5
|-
| 4(Red) || VCC
|}
=== Connection between DIO and analog meter ===
I connected the power and ground from the analog meter with a male-female jumper cable.
The Ground from the analog meter is connected with pin 1.
The power from the analog meter is connected with pin 3. ( What is the first IO )
The power cable is has two resistors connected on it, because even with low PWM values the pointer already went to it's maximum.
The connector pin layout on the DIO:
{| border=1
|-
| 2 || 4 || 6 || 8 || 10
|-
| 1 || 3 || 5 || 7 || 9
|}
For more information about the pin layout see: [[DIO]] & [[I2C connector pinout]]
== Simple Example code ==
In this code I will show how you can make the Analog meter pointer, be at 50% for ten seconds and being off for 10 seconds. It is just easy code to use to check if the connection works between meter, dio and arduino.
#define DIO 0x42
#include <Wire.h>
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
byte get_var(byte address, byte reg)
{
byte value;
Wire.beginTransmission(address);
Wire.write(reg);
Wire.endTransmission();
delayMicroseconds (10);
Wire.requestFrom(DIO, 1);
value = Wire.read();
return value;
}
void set_var(byte address, byte reg, byte value)
{
Wire.beginTransmission(address);
delayMicroseconds (10);
Wire.write(reg);
delayMicroseconds (10);
Wire.write(value);
Wire.endTransmission();
}
void loop()
{
unsigned long DIOAddress;
char buf[32];
set_var(0x42, 0x50, 0x80);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM80: A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
set_var(0x42, 0x50, 0x00);
DIOAddress = get_var(0x50, 0xb);
sprintf (buf, "PWM0 : A:%d \r\n", DIOAddress);
Serial.write (buf);
delay(10000);
}
[[File:ArduinoPWMMeter.jpg|500px]]
== DIO Analog Meter - Clock ==
In this project I made the Arduino version of the clock. What it does is that it read how late it is, and with the time it calculate how much PWM the meter should get to point to the right hour.
The Full script can be found here:
[http://bitwizard.nl/source/ Link]
The file has the name: DIO_CLOCK_ARDUINO2.ino
This script I used for editing is the TimeSerial script( Examples -> Time ), that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino.
You also have to run the program [https://processing.org/ Processing] in my example, with the script SyncArduinoClock running, that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
Stuff that is added to the TimeSerial code:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
}
unsigned long DIOAddress;
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
byte Pwm;
byte NewHour;
Serial.print("\r\nCurrent Hour ");
Serial.print(CurrentHour);
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
First line: Read which hour it's from the processing program and put it on the variable CurrentHour. In the second and third line I have the maximum values given in decimals. ( 255 DEC = FF HEX)
byte CurrentHour = hour();
int HourMax = 11;
int HexMax = 255;
With the given hour it is, it will look if it is above 11.(HourMax) When it's above that number count 12 of it. Example: 18 -> 6.
if (CurrentHour >= HourMax) {
NewHour = CurrentHour - 12;
}
After that the New hour gets printed in the serial monitor. ( The first line that is commented I added, so you can easily change the time )
// NewHour = NewHour + 2;
Serial.print("\r\nNew Hour ");
Serial.print(NewHour);
Here the PWM gets calculated with NewHour and the given values from before. The PWM will first be shown in decimals and then will be transformed to hexadecimals.
After that is done, it wil send the PWM to the DIO.
Pwm = NewHour * HexMax / HourMax;
Serial.print("\r\n Decimal ");
Serial.print(Pwm, DEC);
Serial.print("\r\n Hexadecimal ");
Serial.print(Pwm, HEX);
set_var(0x42, 0x50, Pwm);
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== DIO Analog Meter - Timer ==
In this project I made a timer for the Arduino.
What it does is with the given amount of seconds the analog meter will go from the maximum PWM state(FF) to it's lowest PWM state(zero).
The anolog meter is then used as timer, where you can read of how long you have to wait.
Full code:
[http://bitwizard.nl/source/DIO_TIMER_Arduino2.ino Link]
This script I edited for making this script is the TimeSerial script( Examples -> Time ). This script you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
The [https://github.com/PaulStoffregen/Time Time Library] is required, when you want to work with time on your Arduino. You also have to run the program [https://processing.org/ Processing] in my example, with the script SyncArduinoClock running, that you get when you download the [https://github.com/PaulStoffregen/Time Time Library].
Parts that I added, that I will give some explanation:
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
void digitalClockDisplay(){
unsigned long DIOAddress;
byte CurrentSec = second();
byte PwmValue;
int Progress;
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
set_var(0x42, 0x50, PwmValue);
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
}
Told in my previous arduino clock project:
First line starts writing with time function. Second line lets know to which address to talk to for DIO. The third line is for start writing with I2C.
#include <Time.h>
#define DIO 0x42
#include <Wire.h>
In the second line you can fill in how many seconds you want the progress to take. In this example it is 30 seconds.
The HexMax says the maximum amount that could be given in hexadecimals, what is 255 in decimals. ( In hexadecimals it's FF )
On the fourth line the code will read with processing which second it is and gives it to the variable FirstSec. ( This will only be read the first time )
int EndSec;
int SecValue = 30;
int HexMax = 255;
int FirstSec = second();
Explanation from the arduino clock:
First line: Start writing with I2C. Second line: Make IO0 output. Third line: Enable PWM ON outputs.
After that it calculates what the end amount of seconds is, by counting up the given second value (30 in my example) with first second that got scanned.
Example, we say we start at the 20th second of the minute and want to add 30 seconds: EndSec = FirstSec + SecValue; -> 50 = 20 + 30;
void setup() {
Wire.begin();
set_var(0x42, 0x30, 0x01);
set_var(0x42, 0x5f, 0x01);
EndSec = FirstSec + SecValue;
}
Here in the loop part it will first look which second it is and give it to the variable CurrentSec.
byte CurrentSec = second();
The script will read the current sec and print it out on the serial monitor.
Serial.print("\r\nCurrent Sec ");
Serial.print(CurrentSec);
The progress gets calculated by looking what the endsec value is and counting of that the current second it is in now.
After that it prints in the serial monitor, how far the progress is.
Progress = EndSec - CurrentSec;
Serial.print("\r\nProgress ");
Serial.print(Progress);
The PWM value gets calculated by the given values given earlier and the progress that has been read.
After that the serial monitor will print the PWM value in hexadecimals.
PwmValue = Progress * HexMax / SecValue;
Serial.print("\r\n Hexadecimal ");
Serial.print(PwmValue, HEX);
The given hexadecimal PWM value, will then be send to the DIO.
set_var(0x42, 0x50, PwmValue);
Explanation from the arduino clock:
This part reads the DIO and calculated the given value in hexadecimals. This is to show if the DIO did get the right amount PWM.
DIOAddress = get_var(0x50, 0xb);
Serial.print("\r\n PWM: ");
Serial.print(DIOAddress, HEX);
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[I2C connector pinout]]
*[[Blog 21]] - The Raspberry Pi Version of the above projects + You can read how the background image is made.
*Guide from oopsohno: [https://oopsohno.wordpress.com/2014/04/11/how-to-get-the-arduino-time-library-up-and-going/ How to get the arduino time library up and going]
*[https://processing.org/ Processing]
*[http://www.pjrc.com/teensy/td_libs_Time.html Time Library + Explanation]
*[[Blog list]]
8849cf123209b0741e9950dd27e9503b82321d79
File:ArduinoPWMMeter.jpg
6
1939
3908
2015-12-24T15:02:10Z
Cartridge1987
2553
Setup for the DIO Stepper motor - Clock & Timer.
Appears in [[Blog 22]]
wikitext
text/x-wiki
Setup for the DIO Stepper motor - Clock & Timer.
Appears in [[Blog 22]]
a3b1bf98653376befd6e047a26c3fd6d40ec375c
Blog 23
0
1940
3931
2015-12-29T10:14:12Z
Cartridge1987
2553
Created page with " == Working with multiple analog meters == I got my second analog meter too late, thanks to that my previous clocks/timers only have one analog meter in them. But now I got m..."
wikitext
text/x-wiki
== Working with multiple analog meters ==
I got my second analog meter too late, thanks to that my previous clocks/timers only have one analog meter in them.
But now I got my second analog meter I still want to explain how to get two analog meters to work on one DIO.
=== Connecting the second analog meter ===
The second analog meter I put on pin 4. The DIO has at the connector pins only one ground.
That is why I instead of using a splitter, I just used the I2C connector as ground.
5341dd2ba256bbf2c6c50ed3c41de6666b551e4a
File:TwoMetersOneDIO.jpg
6
1941
3932
2015-12-29T10:15:49Z
Cartridge1987
2553
[[Blog 23]]
wikitext
text/x-wiki
[[Blog 23]]
1c4efe3e614c0ff86a5fb63ecb1b85ec3d115c16
Blog 23
0
1940
3933
3931
2015-12-29T10:25:05Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with multiple analog meters ==
I got my second analog meter too late, thanks to that my previous clocks/timers only have one analog meter in them.
But now I got my second analog meter I still want to explain how to get two analog meters to work on one DIO.
=== Connecting the second analog meter ===
The second analog meter I put on pin 4. The DIO has at the connector pins only one ground.
That is why I instead of using a splitter, I just used the I2C connector as ground.
[[File:TwoMetersOneDIO.jpg|500px]]
19818ed006ea2c83f689b5f2eb4db234edc01876
3934
3933
2015-12-29T11:35:41Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with multiple analog meters ==
I got my second analog meter too late, thanks to that my previous clocks/timers only have one analog meter in them.
But now I got my second analog meter I still want to explain how to get two analog meters to work on one DIO.
Note my explanations are made for the I2C.
=== Connecting the second analog meter ===
The second analog meter I put on pin 4. The DIO has at the connector pins only one ground.
That is why I instead of using a splitter, I just used the I2C connector as ground.
[[File:TwoMetersOneDIO.jpg|500px]]
The Code:
You probably read this before.
But when you want to let the pins work you have to follow three steps.
The first two steps are that you have to enable the PWM and defining which pin as output.
With register 30 you define which pin is an output.
With register 5f you define which pin has to have PWM enabled.
In my example I have the meter connected with pin 3(IO0) + 4(IO1).
The registers work with bitmasking. So, that means that in my example I have to calculate:
Pin 3 + Pin 4 => 01 + 02 = 03.
With that I have to give the value 03.
Now you can change the PWM value of the two pins.
You can this by using register 50-56( From the first pin to the last pin ).
I want to get the first pin have maximum PWM and the second 50%.
The first pin should be register 50 and the value FF. ( It works in two hexadecimals )
The second pin should be register 51 with the value 80.
More about what values are given to which pin you can read in the: [[DIO protocol]]
=== Raspberry Pi ===
The above explanation should look like this in bash code:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:03
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:03
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:FF
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
=== Arduino ===
The above explanation should like this on arduino:
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x03);
set_var(0x42, 0x5f, 0x03);
set_var(0x42, 0x50, 0xFF);
set_var(0x42, 0x51, 0x80);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
667a41e472ae681e7371eeb31dc2abd57734bca7
3935
3934
2015-12-29T11:47:56Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with multiple analog meters ==
I got my second analog meter too late, thanks to that my previous clocks/timers only have one analog meter in them.
But now I got my second analog meter I still want to explain how to get two analog meters to work on one DIO.
Note my explanations are made for the I2C.
=== Connecting the second analog meter ===
The second analog meter I put on pin 4. The DIO has at the connector pins only one ground.
That is why I instead of using a splitter, I just used the I2C connector as ground.
[[File:TwoMetersOneDIO.jpg|500px]]
The Code:
You probably read this before.
But when you want to let the pins work you have to follow three steps.
The first two steps are that you have to enable the PWM and defining which pin as output.
With register 30 you define which pin is an output.
With register 5f you define which pin has to have PWM enabled.
In my example I have the meter connected with pin 3(IO0) + 4(IO1).
The registers work with bitmasking. So, that means that in my example I have to calculate:
Pin 3 + Pin 4 => 01 + 02 = 03.
With that I have to give the value 03.
Now you can change the PWM value of the two pins.
You can this by using register 50-56( From the first pin to the last pin ).
I want to get the first pin have maximum PWM and the second 50%.
The first pin should be register 50 and the value FF. ( It works in two hexadecimals )
The second pin should be register 51 with the value 80.
More about what values are given to which pin you can read in the: [[DIO protocol]]
=== Raspberry Pi ===
The above explanation should look like this in bash code:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:03
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:03
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:FF
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
=== Arduino ===
The above explanation should like this on arduino:
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x03);
set_var(0x42, 0x5f, 0x03);
set_var(0x42, 0x50, 0xFF);
set_var(0x42, 0x51, 0x80);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - For the original Raspberry Pi version of the clock and timer.
*[[Blog 22]] - For the original Arduino version of the clock and timer.
3b86fc52090d8456814d849ddad92bd9026e06f1
3936
3935
2015-12-29T11:48:18Z
Cartridge1987
2553
/* Arduino */
wikitext
text/x-wiki
== Working with multiple analog meters ==
I got my second analog meter too late, thanks to that my previous clocks/timers only have one analog meter in them.
But now I got my second analog meter I still want to explain how to get two analog meters to work on one DIO.
Note my explanations are made for the I2C.
=== Connecting the second analog meter ===
The second analog meter I put on pin 4. The DIO has at the connector pins only one ground.
That is why I instead of using a splitter, I just used the I2C connector as ground.
[[File:TwoMetersOneDIO.jpg|500px]]
The Code:
You probably read this before.
But when you want to let the pins work you have to follow three steps.
The first two steps are that you have to enable the PWM and defining which pin as output.
With register 30 you define which pin is an output.
With register 5f you define which pin has to have PWM enabled.
In my example I have the meter connected with pin 3(IO0) + 4(IO1).
The registers work with bitmasking. So, that means that in my example I have to calculate:
Pin 3 + Pin 4 => 01 + 02 = 03.
With that I have to give the value 03.
Now you can change the PWM value of the two pins.
You can this by using register 50-56( From the first pin to the last pin ).
I want to get the first pin have maximum PWM and the second 50%.
The first pin should be register 50 and the value FF. ( It works in two hexadecimals )
The second pin should be register 51 with the value 80.
More about what values are given to which pin you can read in the: [[DIO protocol]]
=== Raspberry Pi ===
The above explanation should look like this in bash code:
bw_tool -I -D /dev/i2c-1 -a 84 -W 30:03
bw_tool -I -D /dev/i2c-1 -a 84 -W 5f:03
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:FF
bw_tool -I -D /dev/i2c-1 -a 84 -W 50:80
=== Arduino ===
The above explanation should look this on arduino:
void setup()
{
Wire.begin(); // wake up I2C bus
Serial.begin(9600);
set_var(0x42, 0x30, 0x03);
set_var(0x42, 0x5f, 0x03);
set_var(0x42, 0x50, 0xFF);
set_var(0x42, 0x51, 0x80);
}
== Useful links ==
*[[DIO]]
*[[DIO protocol]]
*[[Blog 21]] - For the original Raspberry Pi version of the clock and timer.
*[[Blog 22]] - For the original Arduino version of the clock and timer.
ced1384e5bc16b5a96ea57ad6cb1272cd30ac2e0
Usb ws2812
0
1837
3937
3678
2015-12-30T18:17:22Z
Rew
3
wikitext
text/x-wiki
[[File:usb_ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years).
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
5820470aedd63182d2c67ba58a589f174dd3a363
3942
3937
2016-01-01T14:04:44Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years).
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
029e16c9fcb27e3942697593286ffefd630e9615
Blog 24
0
1942
3938
2015-12-31T17:11:01Z
Cartridge1987
2553
Created page with "== Working with RGB leds on thw WS2812 == Linux/Raspberry apt-get install ckermit"
wikitext
text/x-wiki
== Working with RGB leds on thw WS2812 ==
Linux/Raspberry
apt-get install ckermit
dd84435fded7c0bd740d39588f0e98201cfd0bfb
3940
3938
2016-01-01T13:56:24Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with RGB leds on thw WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== Useful links ==
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
b5ce48c29c67196cf773ad6435487e76b2545fe0
3946
3940
2016-01-01T16:06:38Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== Useful links ==
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
9c806ffa761fd227b2442aa7ae77162f8c691a68
3954
3946
2016-01-06T16:29:57Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
== Useful links ==
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
a3a9b351de8195f34caf4c06f793873ec67e1bf4
3955
3954
2016-01-06T16:34:58Z
Cartridge1987
2553
/* RGB lighted paper Tree */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
[[File:RGBTree1.jpg|none|400px]]
[[File:RGBTree2.jpg|none|400px]]
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
8597fcd559c28140b1b5b8103d901545604b4ac4
3956
3955
2016-01-06T16:41:55Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
[[File:RGBTree1.jpg|none|400px]]
[[File:RGBTree2.jpg|none|400px]]
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
47636d3e9edb7ed3a1ff96ccfef827cba5cdbf66
3957
3956
2016-01-06T16:52:54Z
Cartridge1987
2553
/* RGB lighted paper Tree */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBTree1.jpg|none|400px]]
[[File:RGBTree2.jpg|none|400px]]
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
1231b0bcd88761e04fd51d8849a7ee64c92471ec
3958
3957
2016-01-06T17:27:13Z
Cartridge1987
2553
/* RGB lighted paper Tree */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
=== Making the construction ===
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBTree1.jpg|none|400px]]
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
872509fcb816f12a204fdc4cd980dc7cd5b446c7
3959
3958
2016-01-06T17:43:13Z
Cartridge1987
2553
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
1b2dd5203e2ad43eebc8af4c2160fe384581c2a0
3960
3959
2016-01-07T09:09:00Z
Cartridge1987
2553
/* RGB lighted paper Tree */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
Hardware used:
*[http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 WS2812 usb controller]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
bfdaf9102e6e3628c1eb47fb34c483f84b850514
3961
3960
2016-01-07T09:12:35Z
Cartridge1987
2553
/* RGB lighted paper Tree */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
ef849fd066fe081713db890897825e33d285419b
3962
3961
2016-01-07T09:21:27Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
4fb018ad9b292114724df17e6f7bca941d51bf25
3963
3962
2016-01-07T09:44:57Z
Cartridge1987
2553
/* RGB lighted paper Tree */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the top led (the peak) white. It will then read the for statement where it goes through all the leds under the peak. Every led will randomly get the color green or red. Then the script will keep fading the colors of the leds from to the opposite color. ( red to green or green to red )
The parts that I will give some explanation.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
4c0fb9854da0736cbbc3debb7c0269a725ac4d5a
3964
3963
2016-01-07T09:50:33Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the top led (the peak) white. It will then read the for statement where it goes through all the leds under the peak. Every led will randomly get the color green or red. Then the script will keep fading the colors of the leds from to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
26ea8f7138dbc3f15c7c32c49bf8198da4af02ea
3965
3964
2016-01-07T10:34:47Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the top led (the peak) white. It will then read the for statement where it goes through all the leds under the peak. Every led will randomly get the color green or red. Then the script will keep fading the colors of the leds from to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first ff is making the red led go to it's maximum. The middle ff is for green and the last for blue. It works in hexadecimals so you can lower or make the density higher or lower. And mix them so that you can get different colors as for example yellow.
Here the amount of time and steps in miliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
3e43d54d1d8b197682e38589c9e5e8120884c64a
3966
3965
2016-01-07T11:59:05Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the top led (the peak) white. It will then read the for statement where it goes through all the leds under the peak. Every led will randomly get the color green or red. Then the script will keep fading the colors of the leds from to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first ff is making the red led go to it's maximum. The middle ff is for green and the last for blue. It works in hexadecimals so you can lower or make the density higher or lower. And mix them so that you can get different colors as for example yellow.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Here the colors are given. void fadeto recieves the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statements is the first loop that is getting used. It will count from zero till nine. Every time it counts it will get a random number and use a remainder to divide it with. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that i can be changed to the next number.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. If it then has chosen the certain led it will look if the led is red. If that is true it will say that the newcolor has to become green. Else the opposite will happen, so that the led will become red. The given values will then be sended to fadeto. ( Example: (5, RED, GREEN). After that it will save the newcolour in the previous led color. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
453f26c1fe6d571b3b34d721db682f2a6f6a8d85
3967
3966
2016-01-07T12:41:06Z
Cartridge1987
2553
/* Working with RGB leds on the WS2812 */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
=== Connecting with the WS2812 ===
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY or an other program, which could run the c-program.
On a UNIX device, whebn you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up c. You can make a new terminal and write:
nano .kermrc
That file should only have the code:
SET CARRIER-WATCH OFF
If the carrier-watch is off you have to type c again.
Now you can finally send form an other terminal the information to the ws2812.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
The random name should be the same.
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the top led (the peak) white. It will then read the for statement where it goes through all the leds under the peak. Every led will randomly get the color green or red. Then the script will keep fading the colors of the leds from to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first ff is making the red led go to it's maximum. The middle ff is for green and the last for blue. It works in hexadecimals so you can lower or make the density higher or lower. And mix them so that you can get different colors as for example yellow.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Here the colors are given. void fadeto recieves the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statements is the first loop that is getting used. It will count from zero till nine. Every time it counts it will get a random number and use a remainder to divide it with. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that i can be changed to the next number.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. If it then has chosen the certain led it will look if the led is red. If that is true it will say that the newcolor has to become green. Else the opposite will happen, so that the led will become red. The given values will then be sended to fadeto. ( Example: (5, RED, GREEN). After that it will save the newcolour in the previous led color. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
450cedf5133bcf63bcd4248bc386218a8967328e
3968
3967
2016-01-07T14:10:04Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
=== Connecting with the WS2812 ===
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY or an other program, which could run the c-program.
On a UNIX device, whebn you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up c. You can make a new terminal and write:
nano .kermrc
That file should only have the code:
SET CARRIER-WATCH OFF
If the carrier-watch is off you have to type c again.
Now you can finally send form an other terminal the information to the ws2812.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
The random name should be the same.
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the top led (the peak) white. It will then read the for statement where it goes through all the leds under the peak. Every led will randomly get the color green or red. Then the script will keep fading the colors of the leds from to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first ff is making the red led go to it's maximum. The middle ff is for green and the last for blue. It works in hexadecimals so you can lower or make the density higher or lower. And mix them so that you can get different colors as for example yellow.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Here the colors are given. void fadeto recieves the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statements is the first loop that is getting used. It will count from zero till nine. Every time it counts it will get a random number and use a remainder to divide it with. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that i can be changed to the next number.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. If it then has chosen the certain led it will look if the led is red. If that is true it will say that the newcolor has to become green. Else the opposite will happen, so that the led will become red. The given values will then be sended to fadeto. ( Example: (5, RED, GREEN). After that it will save the newcolour in the previous led color. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
0924bb3a022a03fd23cf4110162f5794380d1762
3969
3968
2016-01-07T14:28:23Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Working with RGB leds on the WS2812 ==
For Linux/Raspberry:
apt-get install ckermit
If you use and other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
=== Connecting with the WS2812 ===
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY or an other program, which could run the c-program.
On a UNIX device, whebn you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up c. You can make a new terminal and write:
nano .kermrc
That file should only have the code:
SET CARRIER-WATCH OFF
If the carrier-watch is off you have to type c again.
Now you can finally send form an other terminal the information to the ws2812.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
The random name should be the same.
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
On ////J7 a connector is added, also an cable from the J1 was connected on pin 15 with the second pin from J7.
The image further on explains itself.
You still have to look out, that you let the pointers point away from the usb ws2812.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I draw a Christmas tree. At the point every single RGB led were laying I put a dot with a pencil.
After that I cut the tree and put holes only on paper with the pencil dots. After that I used some scotch tape to bring it all together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the top led (the peak) white. It will then read the for statement where it goes through all the leds under the peak. Every led will randomly get the color green or red. Then the script will keep fading the colors of the leds from to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first ff is making the red led go to it's maximum. The middle ff is for green and the last for blue. It works in hexadecimals so you can lower or make the density higher or lower. And mix them so that you can get different colors as for example yellow.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Here the colors are given. void fadeto recieves the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statements is the first loop that is getting used. It will count from zero till nine. Every time it counts it will get a random number and use a remainder to divide it with. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that i can be changed to the next number.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. If it then has chosen the certain led it will look if the led is red. If that is true it will say that the newcolor has to become green. Else the opposite will happen, so that the led will become red. The given values will then be sended to fadeto. ( Example: (5, RED, GREEN). After that it will save the newcolour in the previous led color. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashed and has to be resetted. When the RGB leds are still attached they will get a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. After that you can do the previous commands and everything should work fine again.
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
4ae1564c9dd12e3f7215d96eb34254d017448ec7
3970
3969
2016-01-07T17:33:01Z
Cartridge1987
2553
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two zeros can be used for changing the the amount of red color. The middle two zeros are for the amount of green and the last two are for blue. With this you can mix the colors and make different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statements is the first loop that is getting used. It will count from zero till nine. Every time it counts it will get a random number and use a remainder to divide it with. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that i can be changed to the next number.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. If it then has chosen the certain led it will look if the led is red. If that is true it will say that the newcolor has to become green. Else the opposite will happen, so that the led will become red. The given values will then be sended to fadeto. ( Example: (5, RED, GREEN). After that it will save the newcolour in the previous led color. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashed and has to be resetted. When the RGB leds are still attached they will get a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. After that you can do the previous commands and everything should work fine again.
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
3ca60b091cb49a381bd9bf38054ae9680382ee1a
3971
3970
2016-01-08T08:47:56Z
Cartridge1987
2553
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashed and has to be resetted. When the RGB leds are still attached they will get a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two zeros can be used for changing the the amount of red color. The middle two zeros are for the amount of green and the last two are for blue. With this you can mix the colors and make different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statements is the first loop that is getting used. It will count from zero till nine. Every time it counts it will get a random number and use a remainder to divide it with. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that i can be changed to the next number.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. If it then has chosen the certain led it will look if the led is red. If that is true it will say that the newcolor has to become green. Else the opposite will happen, so that the led will become red. The given values will then be sended to fadeto. ( Example: (5, RED, GREEN). After that it will save the newcolour in the previous led color. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
85abbae671501ee436f3ebbbb98f292a17dfb9e9
3972
3971
2016-01-08T08:48:27Z
Cartridge1987
2553
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashed and has to be resetted. When the RGB leds are still attached they will get a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two zeros can be used for changing the the amount of red color. The middle two zeros are for the amount of green and the last two are for blue. With this you can mix the colors and make different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statements is the first loop that is getting used. It will count from zero till nine. Every time it counts it will get a random number and use a remainder to divide it with. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that i can be changed to the next number.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. If it then has chosen the certain led it will look if the led is red. If that is true it will say that the newcolor has to become green. Else the opposite will happen, so that the led will become red. The given values will then be sended to fadeto. ( Example: (5, RED, GREEN). After that it will save the newcolour in the previous led color. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
79648132acc07fc631ca73e4a8bd08c6eaec972e
3973
3972
2016-01-08T09:38:21Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashed and has to be resetted. When the RGB leds are still attached they will get a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
After that the peak led will get white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
fbe8a266d478b74721a2039a049649fdb716462f
3974
3973
2016-01-08T10:33:44Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashed and has to be resetted. When the RGB leds are still attached they will get a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
018069cb7e457dece549873bbe2aa1f9f80cc1c6
3975
3974
2016-01-08T10:35:14Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashed and has to be resetted. When the RGB leds are still attached they will get a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
*[http://www.cplusplus.com/ C programming site]
3a6e4c172a19e6b0110e7aa6acceb54acb5f767f
3978
3975
2016-01-08T11:32:47Z
Cartridge1987
2553
/* Resetting the WS2812 */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have put a male-female cable on pin 5 on the horizontal connector. The male part of the connector should then hit the ground once. The grounds on the ws2812 are the odd numbers for the 16 pins.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
*[http://www.cplusplus.com/ C programming site]
ea35e2c734c10e70ada989fe953480ef3ff1059c
3979
3978
2016-01-08T11:37:04Z
Cartridge1987
2553
/* Resetting the WS2812 */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
Here I made a list of colors(if you also want other colors search for: color table):
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
*[http://www.cplusplus.com/ C programming site]
d9a9d82ee32b6e2d8c83abd285f606fbdd5d1c0f
Main Page
0
1
3939
3521
2016-01-01T13:34:08Z
Rew
3
/* Other boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
cd911240cae6d8389c0a1ed6c6bd096f308853a4
3976
3939
2016-01-08T11:24:30Z
Cartridge1987
2553
/* Breakout boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
701599582d1181bd34a6447df3b0db86679c9814
3977
3976
2016-01-08T11:27:45Z
Cartridge1987
2553
/* Other boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
1b6eb76a33a41a0626071d3b132904bc011f5d51
File:Ws2812.jpg
6
1943
3941
2016-01-01T14:04:12Z
Cartridge1987
2553
[[Usb ws2812]]
wikitext
text/x-wiki
[[Usb ws2812]]
c00cd40e0488ed9143b691bfb770a43906352914
USB-step
0
1944
3943
2016-01-01T14:13:16Z
Rew
3
Created page with "= USB-step = The USB stepper allows you to step a small stepper a certain number of steps at regular intervals. The intended use is for example home-built clocks. == Over..."
wikitext
text/x-wiki
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install XXX this driver, and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
8a29f07327043403dccd167760c67bfd424f01e7
3944
3943
2016-01-01T14:13:36Z
Rew
3
/* programming/protocol */
wikitext
text/x-wiki
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install XXX this driver, and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
49d9dc6c0fcb1aaf31631982d1a53649eb94d841
3945
3944
2016-01-01T14:59:46Z
Rew
3
/* programming/protocol */
wikitext
text/x-wiki
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install XXX this driver, and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
c248ea45c823a86b73f1d7acec01bdf5e1a12ec6
3950
3945
2016-01-06T10:57:58Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install XXX this driver, and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
a626d9b9c8fd4013e8ccdbae377a14abf1cac54e
3981
3950
2016-01-08T12:17:04Z
Cartridge1987
2553
/* pinout */
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install XXX this driver, and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
3c93cfd552a45994e65dae50ff918896954fb9df
Usb-step
0
1945
3947
2016-01-04T09:43:35Z
Cartridge1987
2553
Redirected page to [[USB-step]]
wikitext
text/x-wiki
#REDIRECT[[USB-step]]
7d104ab0bf139b5891f417d09eff8685919a8b64
Usb stepper
0
1946
3948
2016-01-04T09:44:13Z
Cartridge1987
2553
Redirected page to [[USB-step]]
wikitext
text/x-wiki
#REDIRECT[[USB-step]]
7d104ab0bf139b5891f417d09eff8685919a8b64
File:Usbstep.jpg
6
1947
3949
2016-01-06T10:55:32Z
Cartridge1987
2553
[[USB-step]]
wikitext
text/x-wiki
[[USB-step]]
9b0ab865ce5a269420a6150f2206d1fc046e478c
File:RGBTree1.jpg
6
1948
3951
2016-01-06T15:57:31Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:RGBThree.jpg
6
1949
3952
2016-01-06T15:58:16Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:RGBTree2.jpg
6
1950
3953
2016-01-06T15:59:56Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Usb ws 2812
0
1951
3980
2016-01-08T11:54:22Z
Cartridge1987
2553
Redirected page to [[Usb ws2812]]
wikitext
text/x-wiki
#REDIRECT[[Usb ws2812]]
d2981d5903c274be5aff4ee7de3213553298569d
Usb ws2812
0
1837
3982
3942
2016-01-08T12:46:07Z
Cartridge1987
2553
/* Protocol */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
ae3bd2849ee440b28979e3eeccf379db828ac7fb
4020
3982
2016-03-26T09:51:20Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
28073ab6553ce15599b6e753f4b37b83801c6b5e
4021
4020
2016-03-26T09:51:36Z
Rew
3
/* wiring */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Please ignore the other connectors on the board.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a53c1489428e43c253da453a823ee5606a5e4eb0
USB-step
0
1944
3983
3981
2016-01-08T12:46:12Z
Cartridge1987
2553
/* programming/protocol */
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install XXX this driver, and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom/Kermit for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
2f3b3a6fa0f5c1062e1f32396cacb5e0a7e1053e
3993
3983
2016-01-18T15:16:06Z
Cartridge1987
2553
/* programming/protocol */
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install [http://forum.chibios.org/phpbb/download/file.php?id=968&sid=1ea558897dff1ee77df5aa87ad6a008a this driver], and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom/Kermit for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
417fea6e6686c953a3d1d2bc025a1c64f1283edc
3994
3993
2016-01-18T15:57:50Z
Cartridge1987
2553
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install [http://www.bitwizard.nl/software/cdc.zip this driver], and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom/Kermit for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
27b900e6e5f05a6da07d94e29173d71ae493a7fe
4007
3994
2016-03-17T15:58:54Z
Rew
3
/* programming/protocol */
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install [http://www.bitwizard.nl/software/cdc.zip this driver], and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom/Kermit for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands. Some debugging commands beyond the ones listed here may be present.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
'''def''' reads the default settings into the current settings variables.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
More useful settings for the steps-per-second setting (adjusted through the clock command) is 34190060316/60 = 569834339 to make a full revolution every 60 seconds. Another ootion is to set it to 37988956 = 34190060316/60/15 to make a full revolution every 15 minutes. This is used by Oskar van Deventer's tower-gear-clock to drive the minute-hand of the clock through a 1:4 reduction gear in the clock.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
acf1bbb2075402c1f4170ebd7124a0c861e426d6
4008
4007
2016-03-17T15:59:23Z
Rew
3
/* programming/protocol */
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install [http://www.bitwizard.nl/software/cdc.zip this driver], and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom/Kermit for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands. Some debugging commands beyond the ones listed here may be present.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
'''def''' reads the default settings into the current settings variables.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
More useful settings for the steps-per-second setting (adjusted through the clock command) is 34190060316/60 = 569834339 to make a full revolution every 60 seconds. Another option is to set it to 37988956 = 34190060316/60/15 to make a full revolution every 15 minutes. This is used by Oskar van Deventer's tower-gear-clock to drive the minute-hand of the clock through a 1:4 reduction gear in the clock.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
a6c01e4946bf58da3e3cdc5466c5aa9bc16c2a37
4009
4008
2016-03-17T16:00:02Z
Rew
3
/* programming/protocol */
wikitext
text/x-wiki
[[File:usbstep.jpg|thumb|300px|alt=The USB_stepper board|The USB_stepper board]]
= USB-step =
The USB stepper allows you to step a small stepper a certain number of steps at regular intervals.
The intended use is for example home-built clocks.
== Overview ==
The usb-step has basically two connectors. The USB connector (micro USB), and a 5-pin JST for the stepper motor.
The board has a few other connectors for debugging (for us), for power (GND/3V3/5V between the motor and USB connector), for SPI (in the future we might make it possible to add an SPI display for example), and for selecting the voltage of the powerpin of the SPI connector. These connectors are unpopulated.
The board is 50x25.
== pinout ==
The JST power connector is something like
1 - 5V
2 - A+
3 - B+
4 - A-
5 - B-
== default ==
By default the board will step every second, and make a full revolution in 15 minutes.
== programming/protocol ==
When you insert the board into your PC, you will get a virtual com port (VCP).
Under Windows you should get a device for which "no driver could be found". install [http://www.bitwizard.nl/software/cdc.zip this driver], and you will get a virtual com port.
Use your favorite serial-communciation program to connect to the VCP. (I suggest Minicom/Kermit for Linux users, putty for windows-users).
you'll be presented with a commandline interface. The "help" command lists the available commands. Some debugging commands beyond the ones listed here may be present.
'''clock''' lists or sets the "steps-per-second" setting.
'''cal''' lists or sets the crystal calbration.
'''write''' writes the current settings to flash.
'''pat''' allows setting the activation pattern. For forward use: 4 1 2 4 8, for reverse use "4 8 4 2 1" as the arguments.
'''step''' allows setting the time that the motor is activated/stepping speed. Times are in ms.
'''def''' reads the default settings into the current settings variables.
For adjusting the clock setting you must know that the board uses microsteps. It won't drive the motor with better than "full step" resolution, but it uses very small steps internally. The motor will make a full revolution every 34190060316 of these internal steps. The motor is actually stepped when the accumulated number of steps internally exceeds 2^24 = 16777216. So at the slowest setting, 1 internal microstep per second, the motor wil be issued a step every 2^24 seconds (about twice a year), resulting in a full revolution every milennium.
More useful settings for the steps-per-second setting (adjusted through the clock command) is 34190060316/60 = 569834339 to make a full revolution every 60 seconds like the seconds-hand of a clock. Another example is to set it to 37988956 = 34190060316/60/15 to make a full revolution every 15 minutes. This is used by Oskar van Deventer's tower-gear-clock to drive the minute-hand of the clock through a 1:4 reduction gear in the clock.
The time required for each step limits the fastest possible stepping rate. You can experiment with reducing the "step" times with the '''step''' command to see what is the fastest possible step rate with your load.
== current usage ==
the board uses about 120mA per motor-phase that is activated. Normally only one is activated at a time. The motor is powered off between the movements. We measured about 12mA "in rest", Add to that (by default) about 1% times 120mA, the total average power is around 13-14 mA.
== future ==
In the future the interval between each group-of-steps will be configurable, currently fixed at "1s".
5d1057605e34d77c124d86fda73aeebb3bf9e19b
Blog 25
0
1952
3984
2016-01-08T13:39:06Z
Cartridge1987
2553
Created page with " == Working with the usb stepper =="
wikitext
text/x-wiki
== Working with the usb stepper ==
59b3b2617c0d9c795c005b19a0e15017e3b713d5
Blog 24
0
1942
3985
3979
2016-01-08T14:41:44Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
This is the list of colors, with their given RGB values. This can be invoked by typing the capital name.
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors.
Here the amount of time and steps in milliseconds is given for to make the fading go fluent.
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
*[http://www.cplusplus.com/ C programming site]
5244a8f44da3776a5012169f2f2d7e83c16fc968
3986
3985
2016-01-08T15:11:02Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
This is the list of colors, with their given RGB values. This gets invoked later in the script to give the right color value.
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
<!--Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors. -->
( The first two numbers behind 0x are for Red. The second two numbers are for green and the last two are for blue. )
Here the amount of time and steps in milliseconds is given for to make the fading go fluent. ( later used in the script )
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b )
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the rgb led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
*[http://www.cplusplus.com/ C programming site]
28d779e12722a2a870c15e504068cf7350437a8a
3987
3986
2016-01-08T15:46:40Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
This is the list of colors, with their given RGB values. This gets invoked later in the script to give the right color value.
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
<!--Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors. -->
( The first two numbers behind 0x are for Red. The second two numbers are for green and the last two are for blue. )
Here the amount of time in milliseconds and steps given for to make the fading go fluent. ( later used in the script )
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b ).
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color. The value would be send back which then could be printed out in the terminal in that display.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the RGB led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B Operator list of C]
*[http://www.cplusplus.com/ C programming site]
d725ebb071e7a610a46b4f19bdc3783b1f384313
3988
3987
2016-01-11T15:51:18Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
This is the list of colors, with their given RGB values. This gets invoked later in the script to give the right color value.
#define WHITE 0xffffff
#define YELLOW 0xffff00
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x0000ff
#define BLACK 0x000000
<!--Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors. -->
( The first two numbers behind 0x are for Red. The second two numbers are for green and the last two are for blue. )
Here the amount of time in milliseconds and steps given for to make the fading go fluent. ( later used in the script )
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b ).
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color. The value would be send back which then could be printed out in the terminal in that display.
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the RGB led. So in this example it would be that red will change from 80 to 00.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B C Operator list]
*[http://www.cplusplus.com/ C programming site]
56bda0cde6c4a272b630306b9f6d721ef559a359
3989
3988
2016-01-11T16:41:02Z
Cartridge1987
2553
/* The code */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
This is the list of colors, with their given RGB values. This gets invoked later in the script to give the right color value.
#define WHITE 0x808080
#define YELLOW 0x808000
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x000080
#define BLACK 0x000000
<!--Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors. -->
( The first two numbers behind 0x are for Red. The second two numbers are for green and the last two are for blue. )
Here the amount of time in milliseconds and steps given for to make the fading go fluent. ( later used in the script )
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b ).
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color. The value would be send back which then could be printed out in the terminal in that display.
The bit shifting to the right is needed to
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the RGB led. So in this example it would be that red will change from 80 to 00.
The reason for making it 80, instead of FF is to makes the light not hurting your eyes.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values. It also print that information in the C-Kermit terminal.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B C Operator list]
*[http://www.cplusplus.com/ C programming site]
2e0a810f7733bc644b60d5907ce4673b4971dfd9
Default address
0
1953
3990
2016-01-13T11:31:11Z
Cartridge1987
2553
Redirected page to [[Default addresses]]
wikitext
text/x-wiki
#REDIRECT[[Default addresses]]
e06e3c1ccd18a7c702b84c3c7fdfbdce1b470443
Blog 26
0
1954
3991
2016-01-13T17:28:26Z
Cartridge1987
2553
Created page with " Hardware used: *[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[spi relay]] *[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[..."
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[spi relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
1fe4c5bdfbc3a18ce521d41e8cf0d1aab055f1ac
3996
3991
2016-01-21T10:03:50Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
f9f37425b0f6dd8166deede67c1036dc5df6a148
3998
3996
2016-01-21T14:23:31Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm 6 PIN IDC cable]
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
65d8c7c16aad5364bffc9b4b42c91419aac37a82
3999
3998
2016-01-21T14:24:21Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm IDC Cables, 6 Pin (SPI)]
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
a2b4cb404087ce7af1947cda768b7100c94ed1f8
4001
3999
2016-01-22T15:13:55Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm IDC Cables, 6 Pin (SPI)]
Hello,
In this project I worked on a controllable sp relay. What the goal was that you could control the amount of pulses and the pulse time of the relay.
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
f181fec13f8cd8838e624ede84bf1001caf20a08
4002
4001
2016-01-22T16:51:07Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm IDC Cables, 6 Pin (SPI)]
Hello,
In this project I worked on a controllable sp relay. What the goal was that you could control the amount of pulses and the pulse time of the relay.
Link to the code: [http://bitwizard.nl/source/Pulsecontroller.ino click here]
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
e976036a12a2c0a9e314523f60e0f46de5f77ee6
4003
4002
2016-01-22T17:24:41Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm IDC Cables, 6 Pin (SPI)]
Hello,
In this project I worked on the arduino. I made an pulse controller. With that you can control the amount of pulses and the pulse time of the relay.
Link to the code: [http://bitwizard.nl/source/Pulsecontroller.ino click here]
I made this script building on the [[http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script]]. The parts I am going to explain are only for my script part.
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
*[[http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script]] - My script uses the basics of that script.
ef73037b7575f5c9b7ada3ae8038eebb1be71d3e
4004
4003
2016-02-04T07:57:52Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm IDC Cables, 6 Pin (SPI)]
Hello,
In this project I worked on the arduino. I made an pulse controller. With that you can control the amount of pulses and the pulse time of the relay.
Link to the code: [http://bitwizard.nl/source/Pulsecontroller.ino click here]
I made this script building on the [http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script]. The parts I am going to explain are only for my script part.
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
*[[http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script]] - My script uses the basics of that script.
38bc5b8d88ecefc454d55b099a905f79ac705374
4005
4004
2016-02-04T07:58:12Z
Cartridge1987
2553
/* Useful links */
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm IDC Cables, 6 Pin (SPI)]
Hello,
In this project I worked on the arduino. I made an pulse controller. With that you can control the amount of pulses and the pulse time of the relay.
Link to the code: [http://bitwizard.nl/source/Pulsecontroller.ino click here]
I made this script building on the [http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script]. The parts I am going to explain are only for my script part.
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
*[http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script] - My script uses the basics of that script.
53a4b8e521258d3309279a9440c1e63ee42e6f3f
4006
4005
2016-02-09T10:55:34Z
Cartridge1987
2553
wikitext
text/x-wiki
Hardware used:
*[http://www.bitwizard.nl/shop/expansion-boards/relay SPI Relay] | [[SPI Relay]]
*[http://www.bitwizard.nl/shop/raspberry-pi-ui-20x4 User interface 20x4] | [[User Interface]]
*Two [http://bitwizard.nl/shop/cables-connectors/6-pin-idc-cable-30cm IDC Cables, 6 Pin (SPI)]
Hello,
In this project I worked on the arduino. I made an pulse controller. With that you can control the amount of pulses and the pulse time of the relay.
Link to the code: [http://bitwizard.nl/source/Pulsecontroller.ino click here]
I made this script building on the [http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script]. The parts I am going to explain are only for my script part.
In the script itself I also added some explanation.
Setup part:
//int offms = 500;
int OnTime = 500;
unsigned int s = 0;
int pulses = 1;
int PulseTime = 500;
set_var (0x8e, 0x10, 0x00);
PulsPrint(pulses);
TimePrint(PulseTime);
char bufline2[32];
char bufline4[32];
sprintf(bufline2, "1=down |2=up |5=res", bufline2);
write_at_lcd (0, 1, bufline2);
delay(10);
sprintf(bufline4, "3=down |4=up |6=run", bufline4);
write_at_lcd (0, 3, bufline4);
Serial.write (bufline2);
Serial.write ("\r\n");
Serial.write (bufline4);
Serial.write ("\r\n");
loop part:
// read the buttons:
int Button = get_var (0x94, 0x31);
// print out the state of the buttons:
Serial.println(Button);
//Button 6
//runs the pulses with the given pulse time to the relay
if (Button == 1){
Pulsing(pulses);
get_var (0x94, 0x31);
}
// Button 5
// reset the pulses and time back to the start settings
if (Button == 2){
PulseTime = 500;
pulses = 1;
TimePrint(PulseTime);
PulsPrint(pulses);
delay(OnTime);
get_var (0x94, 0x31);
}
// button 4
// +0.1 second to the previous amount of time
// the maximum amount of seconds is 10
if (Button == 4){
PulseTime = PulseTime + 100;
if ( PulseTime > 10000) PulseTime = 10000;
TimePrint(PulseTime);
delay(OnTime);
get_var (0x94, 0x31);
}
// button 3
// -0.1second to the previous amount of time
// The minimum amount of seconds is 0.1.
if (Button == 8){
PulseTime = PulseTime - 100;
if ( PulseTime < 100) PulseTime = 100;
TimePrint(PulseTime);
delay(OnTime);
get_var (0x94, 0x31);
}
// button 2
// +1 to the previous value pulses
// the maximum amount of pulses is 99
if (Button == 16){
pulses = pulses +1;
if ( pulses > 99) pulses = 99;
PulsPrint(pulses);
delay(OnTime);
get_var (0x94, 0x31);
}
// button 1
// -1 to the previous value pulses
// the minimum value is 1
if (Button == 32){
pulses = pulses - 1;
if ( pulses < 1) pulses = 1;
PulsPrint(pulses);
delay(OnTime);
get_var (0x94, 0x31);
}
delay(20);
}
functions:
//function that shows the amount of pulses on the display
void PulsPrint(int Puls){
char buf[32];
sprintf (buf, "Pulses: %02d", Puls);
write_at_lcd (0, 0, buf);
Serial.write (buf);
Serial.write ("\r\n");
}
// function that shows the pulsetime on the display
void TimePrint(int Time){
float FloatTime = Time;
FloatTime = FloatTime/1000;
delay(10);
char TextBuf[32];
char buf[32];
sprintf(TextBuf, "Time: seconds", buf);
write_at_lcd (0, 2, TextBuf);
dtostrf (FloatTime,3, 1, buf);
write_at_lcd (7, 2, buf);
Serial.write (TextBuf);
Serial.write (buf);
Serial.write ("\r\n");
}
// function that will run the given pulses and pulsetime
void Pulsing(int Puls){
int PulsHalf = PulseTime / 2;
for (int count = 0; pulses > count; count++){
set_var (0x8e, 0x20, 0x01);
delay(PulsHalf);
set_var (0x8e, 0x20, 0x00);
delay(PulsHalf);
}
}
== Useful links ==
*[[DIO protocol]] - The SPI relay has the same protocol
*[[User Interface]]
*[http://www.bitwizard.nl/software/ardemo_lcd.pde arduino spi demo script] - My script uses the basics of that script.
c23dd3dc70b64f3a4e2c55fa06b93ec95a3ba866
User Interface
0
1505
3992
3535
2016-01-14T15:02:40Z
Cartridge1987
2553
/* Read ports */
wikitext
text/x-wiki
[[File:RPi-UI.jpg|thumb|300px|alt=The RPi_UI PCB|The RPi_UI PCB]]
This is the documentation page for the RPi_UI board. That can be found in the [http://www.bitwizard.nl/shop/index.php?route=product/search&search=user%20interface BitWizard shop].
== Installation ==
See [[bw_tool#Setting up I2C/SPI under Linux | Setting up I2C/SPI under Linux]]
== External resources ==
=== Datasheets ===
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22266D.pdf MCP79412 (I2C RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf MCP79522 (SPI RTC)]
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 thermistor]
== Additional software ==
The [[Bw_tool]] is meant to provide a basic commandline access to the bitwizard expansion boards
== Pinout ==
The 26 pin gpio connector is described at [http://elinux.org/RPi_Low-level_peripherals elinux]<br>
The SPI connector has the same pinout as the atmel 6-pin ICSP connector and is documented here: [[SPI_connector_pinout]].<br>
The I2C connector is documented here: [[I2C_connector_pinout]].<br>
The UART connector is documented here: [[uart connector pinout]].<br>
The analog connector has the following pinout:
{| border=1
! pin !! function
|-
| 1 || 5V
|-
| 2 || Analog in
|-
| 3 || GND
|}
Some people report they find it difficult to read the names of the connectors on the PCB. We'll fix that in a future version. In the meanwhile:
[[File:Rpi_ui_docu.png|none|thumb|500px|alt=The RPi_UI PCB|The RPi_UI PCB]]
Note that for the 20x4 version of the board, the connectors are in the same order with the same pinout.
=== LEDs ===
The only LED is a power indicator.
== Jumper settings ==
There is one 2x2 pin jumper (JP1), which controls which SPI bus (actually which SPI chip-select line) is routed to the AVRs slave-select pin, and which is routed to the reset pin (to enable reprogramming of the AVR):<br>
Left pads/pins connected: SPI0 connected to Slave-Select
Right pads/pins connected: SPI1 connected to RESET
Bottom pads/pins connected: SPI0 connected to RESET
Top (near the LCD) pads/pins connected: SPI1 connected to Slave-Select
The recommended configuration is to have 1-3 connected. The pins 1 and 2 are marked on the PCB. So 1-3 means the jumper is closest to the board edge, running from the "1" to the "J" of "JP1".
People with the buttons/LCD on I2C can/should not install any jumpers here.
There is also one solder jumper, SJ1, which controls the supply voltage on the SPI, I2C, and UART connectors:<br>
1-2: 5V (left)<br>
2-3: 3V3 (right, near the PCB edge)
We deliver this jumper in the "5V" position with a small PCB trace. If you want to switch to 3.3V you'll have to cut the small trace with a knife.
== Protocol ==
To make the RPI_UI PCB do things, you need to send things over the SPI or I2C bus to the PCB. A comparison of the two protocols can be found [[SPI_versus_I2C_protocols|here]].
The general overview of the SPI protocol is [[General_SPI_protocol|here]].
the list of the default addresses is [[Default_addresses|here]].
== The software ==
Controlling the display works the same way as our SPI_LCD or I2C_LCD modules. Reading the pushbuttons is very much like the DIO module. The read and write ports are described below.
=== Write ports ===
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.
The rpi_ui board defines several ports.
{| border=1
! port !! function
|-
| 0x00 || display data.
|-
| 0x01 || write data as command to LCD.
|-
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. works from version 1.6+
|-
| 0x09 || Set startup message line 2.
|-
| 0x0a || Set startup message line 3.
|-
| 0x0b || Set startup message line 4.
|-
| 0x10 || any data clears the screen.
|-
| 0x11 || move the cursor to line l, position p. <br>l is the top 3 bits<br>p is the bottom 5 bits of the data.
|-
| 0x12 || set contrast.
|-
| 0x13 || set backlight.
|-
| 0x14 || reinit LCD. The initialzation procedure of the LCD takes a long time. A timed delay of about 500ms is in order after issuing this command
|-
| 0x15 || send 0 to set overrun-status back to zero.
|-
| 0x17 || Set the boot-time backlight intensity. (0xff means: use programmed default (0xc0))
|-
| 0x20 || set display number-of-lines. These are passed on to the display software, but seem to have little effect.
|-
| 0x21 || set display number-of-characters.
|-
| 0x70 .. 0x71 || Select which i/o is coupled to which ADC channel
|-
| 0x80 || Set number of ADC channels to read
|-
| 0x81 || Set number of samples to add (we suggest using a power of 2) (two bytes) See: [[annoying bug]]
|-
| 0x82 || Set ammounts of bits to shift accumulated sample value
|-
| 0xf0 || change address. But need to unlock first. See below. <br> Might require a reboot to take effect.
|-
| 0xf1 || change address: unlock phase 1: write 0x55 here to start unlocking.
|-
| 0xf2 || change address: unlock phase 2: write 0xaa here to allow changing of the address (after writing 0x55 to f1).
|}
=== Read ports ===
The rpi_ui board supports several read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x02 || read eeprom (serial number).
|-
| 0x12 || contrast
|-
| 0x13 || backlight intensity
|-
| 0x15 || read FIFO(first in, first out) overrun status. If different from previous value, you've had an overrun. Best to
clear the screen and resend any data you want displayed.
|-
| 0x16 || read FIFO bytes-in-buffer. The fifo is 32 bytes, So you can send 20 chars to display if the value is less than 12.
|-
| 0x17 || read stored backlight intensity.
|-
| 0x20 || read button 1 (1 means NOT pushed, 0 means pushed)
|-
| 0x21 || read button 2 (1 means NOT pushed, 0 means pushed)
|-
| 0x22 || read button 3 (1 means NOT pushed, 0 means pushed)
|-
| 0x23 || read button 4 (1 means NOT pushed, 0 means pushed)
|-
| 0x24 || read button 5 (1 means NOT pushed, 0 means pushed)
|-
| 0x25 || read button 6 (1 means NOT pushed, 0 means pushed)
|-
| 0x30 || reports which buttons have been pushed since last read of this register<br>
If you keep a button pushed, it will read out as 1 multiple times
|-
| 0x31 || reports which buttons have been pushed since last read of this register (V1.2 and up)<br>
If you keep a button pushed, it will read out as 1 only once
|-
| 0x40 || read button 1 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x41 || read button 2 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x42 || read button 3 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x43 || read button 4 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x44 || read button 5 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x45 || read button 6 (1 means pushed, 0 means NOT pushed) (V1.1 and up)
|-
| 0x60.. 0x61 || Return analog value (2 bytes)
|-
| 0x68 .. 0x69 || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x71 || Return which i/o is coupled to which ADC channel
|-
| 0x80 || Return number of ADC channels to read
|-
| 0x81 || Return number of samples to add (two bytes)
|-
| 0x82 || Return ammounts of bits to shift accumulated sample value
|}
== Using the analog inputs ==
Please see [[DIO_protocol#Using_the_analog_inputs|this]] chapter on the page explaining the DIO protocol. There are two major differences:
* The internal reference voltage needs to be configured in a different way
* The mapping of the analog inputs; please use the following table instead:
{| border=1
! IO pin !! value
|-
| temp || 0xC7 (Vref=1V1) OR 0x47 (Vref=Vcc=~5V)
|-
| ext || 0xC6 (Vref=1V1) OR 0x46 (Vref=Vcc=~5V)
|}
=== Example ===
Setup the ADC (only needed once after reboot):
bw_tool -a 94 -w 70:c7 //Set ADC channel 0 to temperature sensor, and internal 1V1 reference
bw_tool -a 94 -w 80:01 //Set number of channels to sample to 1
Read the value:
bw_tool -a 94 -R 60:s // Read the result, output in hex
== Using the temperature sensor ==
The temperature sensor is a MCP9700. It's output voltage depends on the temperature. For more information, please see the [http://ww1.microchip.com/downloads/en/DeviceDoc/21942e.pdf MCP9700 datasheet].
An initialization and readout script are available on the [[Temperature sensor example]] page.
== Using the RTC ==
We first designed the User Interface to be equipped with either an SPI RTC or an I2C RTC. In practice the driver for the i2c version was a lot easier, so we're not selling the ones with the SPI RTC unless you really, really want (and we haven't run out of boards by then).
=== I2C ===
The I2C RTC has a Linux driver, which is available in the standard kernels delivered with raspian. (and probably others too).
Just use:
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device
and the module is loaded and detects the RTC.
You can then set the RTC with: "hwclock -w". This will write the unix clock to the RTC. Put a "hwclock -s" somewhere in your startup scripts to initialize the unix clock from the RTC.
The version 1 raspberry pi's had the i2c-0 bus on the gpio connector, you for the older raspberry pi you'll need to change i2c-1 into i2c-0..
=== SPI ===
We are not aware of a device driver for the SPI version of the RTC. We can read/write the RTC with bw_tool from the command line using the raw SPI bytes command line option "--hex". The CPU on the board has to enable the CS line for the SPI RTC. This limits the speed of the SPI transactions a bit (50 kHz has been verified working).
bw_tool -s 50000 --hex 96 12 20 1 2 34 5 6 7 89
will write (0x12) the test-bytes 1 2 34 5 6 7 89 to the RAM at location 0x20 in the RAM.
bw_tool -s 50000 --hex 96 13 20 0 0 0 0 0 0 0 0
will read them back.
Refer to the datasheet of the MCP79522 for information on the registers of the chip http://ww1.microchip.com/downloads/en/DeviceDoc/22300A.pdf
= Examples =
== Read identification ==
read the identification string of the board.
{| border=1
! data sent !! data recieved || explanation
|-
| 0x95 || xx || select destination with address 0x94 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
== Send text to display ==
Display the string "Hello World!" (only the first 5 bytes of the string shown).
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x00 || xx || datastream
|-
| 0x48 || xx || 'H'
|-
| 0x65 || xx || 'e'
|-
| 0x6c || xx || 'l'
|-
| 0x6c || xx || 'l'
|-
| 0x6f || xx || 'o'
|-
| xx || ... || etc.
|}
== Set cursor position ==
move to line 1, character 5:
{| border=1
! data sent !! data recieved || explanation
|-
| 0x94 || xx || select destination with address 0x94 for WRITE
|-
| 0x11 || xx || port 0x11 = set cursor position.
|-
| 0x25 || xx || 0x25 = 001 00101 = line 1 position 5.
|}
== Bash script to show system informations ==
This bash script shows the current time and load averages of the cpu. The refresh is set to 5 seconds.
#!/bin/bash
# What display to use:
DISPL="bw_tool -I -D /dev/i2c-1 -a 94"
# e.g. for SPI use:
#DISPL="bw_tool -D /dev/spidev1.0 -a 94"
#clean the display
$DISPL -W 10:0:b
while true; do
#get cpu loads
load=`cut -d' ' -f-3 /proc/loadavg`
#print the current time
$DISPL -W 11:00:b
$DISPL -t `date +%H:%M:%S`
#print the load averages
$DISPL -W 11:20:b
$DISPL -t $load
#idle for 5 seconds
sleep 5
done
== Changelog ==
=== 1.0 ===
* Initial public release
c9a27d652b88bb195b35a630af8682c7489e1d4b
Rpi ssr
0
1955
3995
2016-01-20T15:32:03Z
Cartridge1987
2553
Redirected page to [[Raspberry Relay]]
wikitext
text/x-wiki
#REDIRECT[[Raspberry Relay]]
8b44a1e019f8f08d96170ab6f4695e4fe2485cdc
SPI Relay
0
1956
3997
2016-01-21T10:04:30Z
Cartridge1987
2553
Redirected page to [[Relay]]
wikitext
text/x-wiki
#REDIRECT[[Relay]]
77541bac07154ac844bcd7abb2855f02d9ebaa75
File:Arduinorelay.jpg
6
1957
4000
2016-01-22T09:33:01Z
Cartridge1987
2553
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 1.jpg
6
1958
4010
2016-03-25T13:55:53Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 2.jpg
6
1959
4011
2016-03-25T13:56:06Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 3.jpg
6
1960
4012
2016-03-25T13:56:20Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 8.jpg
6
1961
4013
2016-03-25T13:56:50Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 7.jpg
6
1962
4014
2016-03-25T13:56:53Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 6.jpg
6
1963
4015
2016-03-25T13:56:56Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 5.jpg
6
1964
4016
2016-03-25T13:57:00Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 4.jpg
6
1965
4017
2016-03-25T13:57:04Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 9.jpg
6
1966
4018
2016-03-25T14:12:53Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Assembling the DMX case
0
1967
4019
2016-03-25T14:14:50Z
Sjoerd
2544
Created page with "= Assembling the DMX case = [[File:DMX_case_9.jpg|600px|DMX case]] == Included == Included screws and washers/spacers 10x m3x6 4x m3x12 4x m2.5x10 4x m3x4mm spacer ..."
wikitext
text/x-wiki
= Assembling the DMX case =
[[File:DMX_case_9.jpg|600px|DMX case]]
== Included ==
Included screws and washers/spacers
10x m3x6
4x m3x12
4x m2.5x10
4x m3x4mm spacer
4x m3x18mm spacer
12x m3 plastic washer
== Step 1 ==
4x m3x6
4x m3x12
4x m3x4mm spacer
4x m3x18mm spacer
12x m3 plastic washer
[[File:DMX_case_1.jpg|400px|DMX case - step 1]]
[[File:DMX_case_3.jpg|400px|DMX case - step 1]]
[[File:DMX_case_4.jpg|400px|DMX case - step 1]]
== Step 2 ==
[[File:DMX_case_5.jpg|400px|DMX case - step 2]]
== Step 3 ==
6x m3x6
4x m2.5x10
[[File:DMX_case_6.jpg|400px|DMX case - step 3]]
[[File:DMX_case_7.jpg|400px|DMX case - step 3]]
[[File:DMX_case_8.jpg|400px|DMX case - step 3]]
14268cbff854d3986f4743e4161a6c48d05b0635
Dmx interface for raspberry pi
0
1968
4022
2016-03-31T13:33:39Z
Rew
3
Created page with " = Introduction = The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware. There is also a version "with FT245" That version adds ..."
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
On raspbian installin OLA is easy: ''apt-get install ola'' should do the trick.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
Most importantly: add:
init_uart_clock=160000000
to your config.txt file in the /boot directory.
Next, you need to co9nfigure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!
fbc49655d460222feb1db366e08fbf68398877ab
4023
4022
2016-03-31T14:14:14Z
Rew
3
/* OLA */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
On raspbian installin OLA is easy: ''apt-get install ola'' should do the trick.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
Most importantly: add:
init_uart_clock=160000000
to your config.txt file in the /boot directory.
Next, you need to co9nfigure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
e1e3432d5f0cfb9bc79699536b5b2300aaa416f2
4024
4023
2016-04-01T14:36:06Z
Rew
3
/* OLA */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
On raspbian installin OLA is easy: ''apt-get install ola'' should do the trick.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to co9nfigure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
690442fc03c5d6a2d398d17874dd455d0ee22cf1
4025
4024
2016-04-05T17:23:07Z
Rew
3
/* OLA */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to co9nfigure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
d64ee77f438536edf76646e1d9d7d6b15ad7dac5
4026
4025
2016-04-05T17:24:43Z
Rew
3
/* OLA */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
e6cad09a64110f82c144613e2b4470137fc366ef
4027
4026
2016-04-06T10:12:25Z
Rew
3
/* OLA */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
===== raspberry pi 3 ====
Add:
device_tree=bcm2709-rpi-2-b.dtb
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
9be0c26b6870bfe984462e5e375144307038e671
4028
4027
2016-04-06T10:12:38Z
Rew
3
/* = raspberry pi 3 */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
device_tree=bcm2709-rpi-2-b.dtb
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
echo 18 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
4f1126fe8e40c43225727d1fb820a6e72a902592
4029
4028
2016-04-06T10:18:56Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
device_tree=bcm2709-rpi-2-b.dtb
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
1f1ca9ee5935a0381adfc6150854a027bfe4d8d4
4030
4029
2016-04-06T10:25:20Z
Rew
3
/* raspberry pi 3 */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/''). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
ca9f6387d3668488ea482291c681a18b11404d96
4031
4030
2016-04-10T09:22:30Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
todo
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
8dec1143a3f95f9369719fa3216ac596292eecf5
Dmx interface for raspberry pi
0
1968
4032
4031
2016-04-21T20:44:50Z
Rew
3
/* QLC */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
f3050c2de0a29d939f0e0b09c7aa278cdf58a60d
4055
4032
2016-05-29T19:36:25Z
Rew
3
/* software */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
a0a5da23d5222c32f55cffe2585b2cfbdb690718
4056
4055
2016-05-29T19:36:54Z
Rew
3
/* QLC+ */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
b4164781601f524026faf6523cc3bb75d8d98a04
4057
4056
2016-06-15T14:05:51Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
git clone https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
2bf899a43589af22af2be82842585ed29f8e4aba
4058
4057
2016-06-15T14:06:12Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
1ff15513ce1186724f3c3b5ed530222f600d3400
4059
4058
2016-06-15T14:07:23Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
384a92f89d273c726ffd9a7c18ce31257b7ffcf0
4060
4059
2016-06-15T14:23:07Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake libtool
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
e324e97620b8392d37e03fe02ae565e81eb5ed5d
4061
4060
2016-06-15T14:26:36Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake libtool
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
d8fb2d94b8750c9a3ae1e271ab98d292b3bdf91a
4062
4061
2016-06-15T14:30:52Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake libtool bison
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
95d8117d9b8d61799cc3956af5d017278280a047
4063
4062
2016-06-15T14:41:16Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake libtool bison flex libcppunit-dev
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
2791c261e030e6c84c8991c85439f35b7c2b65f3
4064
4063
2016-06-15T15:03:26Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
eb775d212204f1c2207c1ec1cc99e56b6cb9f4fe
4066
4064
2016-06-15T15:34:01Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
ede2ae8914d085d5d8e1213c161f57d17fb256f3
4067
4066
2016-06-17T12:29:55Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
9323fef13994dea82b6a311ef99f1bc7a4007797
4068
4067
2016-06-17T14:01:47Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
48bafcda6d54f3ac17f7cf8e91987d626469b02b
4069
4068
2016-06-17T14:04:45Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
d2bb00b7870b1c294c690492ca76e9704d7a3051
4070
4069
2016-06-17T14:17:23Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
b9e8000fda5adc6192b080eca1274fc634c97f39
4074
4070
2016-06-20T14:49:26Z
Sjoerd
2544
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
50636d79192c967d26063c4490985a1f42fb512f
4075
4074
2016-06-20T14:53:38Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
eb4fa18a3bee66ea636d03d9ddeefd9b793e7dde
4076
4075
2016-06-20T15:02:54Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 100
device = /dev/ttyAMA0
enabled = true
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
111aa58a6ad9084f4ef7813d978558419728b57a
4077
4076
2016-06-20T16:24:01Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
f68b6d2625f3a0f557652925c62906a3914eb850
Motor
0
658
4033
3529
2016-04-22T06:35:00Z
Rew
3
/* Possible Configurations */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board. That can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/motor BitWizard shop].
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 10V to 14V power supply. Please refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2. The motor voltage is used to drive the FETs
|-
| >14V || Jumper on pins 2 and 3. The onboard regulator generates 12V from the motor voltage.
|}
If a FET is built to use 12V gate voltages, it will only conduct partially when you drive it with lower voltages. The FET would run hot or self-destruct very quickly if that happens. So to prevent this from happening the FET-driver will not drive the FET at all if the gate-drive-voltage is not above 8V. That is why even if your motor runs on 5V you cannot use 5V for the gate-drive-voltage.
=== LEDs ===
The only LED is a power LED.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
f8816eb2c5e75f5a9a45ba50b1e7174a6f94434b
Blog 24
0
1942
4034
3989
2016-04-29T11:03:45Z
Nancygo
2563
/* Making the construction */
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. Similar scheme with instructions were at http://essaydune.com. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
This is the list of colors, with their given RGB values. This gets invoked later in the script to give the right color value.
#define WHITE 0x808080
#define YELLOW 0x808000
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x000080
#define BLACK 0x000000
<!--Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors. -->
( The first two numbers behind 0x are for Red. The second two numbers are for green and the last two are for blue. )
Here the amount of time in milliseconds and steps given for to make the fading go fluent. ( later used in the script )
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b ).
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color. The value would be send back which then could be printed out in the terminal in that display.
The bit shifting to the right is needed to
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the RGB led. So in this example it would be that red will change from 80 to 00.
The reason for making it 80, instead of FF is to makes the light not hurting your eyes.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values. It also print that information in the C-Kermit terminal.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B C Operator list]
*[http://www.cplusplus.com/ C programming site]
0265837ee2def2f0ad4a860736d99ca3aac42d6c
4035
4034
2016-04-29T11:46:21Z
Rew
3
Undo revision 4034 by [[Special:Contributions/Nancygo|Nancygo]] ([[User talk:Nancygo|talk]])
wikitext
text/x-wiki
== Connecting the WS2812 ==
First you just have to connect the WS2812 with a micro-USB cable to your device.
You have to use C-kermit or PuTTY:
For Linux/Raspberry:
apt-get install ckermit
If you use an other device, or want to know more:
[http://www.kermitproject.org/ck90.html C-Kermit]
For Windows users it's optional to use:
[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
On a UNIX device, when you want to run the code from the device to the WS2812. You have to type in the terminal:
/usr/bin/kermit -l /dev/ttyACM0
It could be that you have to send to/from an other destination.
It will then say C-kermit is opened. You then just have to type the letter:
c
It will tell you to turn off carrier watch with:
SET CARRIER-WATCH OFF
If you don't want to ask this every time you start up with c. You can make a new terminal and write:
nano .kermrc
That file(.kermrc) should only have the code:
SET CARRIER-WATCH OFF
When the carrier-watch is off you have to type c again.
Before you send a code to the ws2812 check it with:
gcc -Wall -o randomname randomname.c
After that you can send it to the ws2812 with:
./randomname > /dev/ttyACM1
== Resetting the WS2812 ==
Maybe you will get the experience that the ws2812 crashes and has to be reseted. When the RGB leds are still attached they will give a rainbow effect. To reset the WS2812 you have to put a cable in pin 5 of the 6 pin connector with a ground. The ground of the ws2812 is every odd number on the 16 pin connector.
After that you can do the previous commands and everything should work fine again.
== RGB lighted paper Tree ==
Hardware used:
*WS2812 usb controller: [http://bitwizard.nl/shop/index.php?route=product/product&product_id=161 Shop link] | [[Usb ws2812|Wiki link]]
*RGB led strip
*Equipment wire
Software used on my linux pc:
*C-kermit
=== Making the construction ===
The RGB leds:
[[File:RGBTree1.jpg|none|400px]]
The image pretty much explains itself. What you have to do is connect RGB with the 3-pin header.( GND - pin 1 | DO - pin 2 | +5V - pin 3 )
The pointers of this example RGB strip should be pointing away from the WS2812 usb controller.
Paper tree:
The paper tree is made by folding a green paper. On the folded green paper I put my RGB led connection. Around the RGB led I drew a Christmas tree. At the points where every single RGB led were laying I put a dot by using a pencil.
After that I cut the tree out and made holes at the pencil dots. After that I used some scotch tape to bring the front and back paper together. The final result:
[[File:RGBTree2.jpg|none|400px]]
You can of course go all crazy with the tree by adding glitters and stuff like that.
=== The code ===
The full c-program RGBTree.c can be downloaded: [http://bitwizard.nl/source/ here].
What the code does in short is this: When starting up it will make the the peak RGB led white. It will then read the for statement where it goes through all the RGB leds(Except the peak). Every RGB led will randomly get the color green or red. The script will then keep fading the colors of the RGB leds to the opposite color. ( red to green or green to red )
The parts of the script that I will give some explanation:
This is the list of colors, with their given RGB values. This gets invoked later in the script to give the right color value.
#define WHITE 0x808080
#define YELLOW 0x808000
#define RED 0x800000
#define GREEN 0x008000
#define BLUE 0x000080
#define BLACK 0x000000
<!--Because it's RGB ( red green blue ) the first two numbers after 0x can be used for changing the red color value. The middle two numbers are for the amount of green and the last two are for blue. With RGB you can mix the colors into different colors. -->
( The first two numbers behind 0x are for Red. The second two numbers are for green and the last two are for blue. )
Here the amount of time in milliseconds and steps given for to make the fading go fluent. ( later used in the script )
int nfadesteps = 30;
int delayms = 30;
In interpolate it will get the values from fadeto three times ( for every color r, g & b ).
It will give new values to c1 and c2 it will bit shift it to the right, and give it the value together with 0xff.
After that it calculates difference between previous color. The value would be send back which then could be printed out in the terminal in that display.
The bit shifting to the right is needed to
int interpolate (int c1, int c2, int shift, int pos, int end)
{
c1 >>= shift;
c2 >>= shift;
c1 &= 0xff;
c2 &= 0xff;
return c1 * (end-pos) / end + c2 * pos / end;
}
Void fadeto receives the information from int main for example: (5, RED, GREEN).
It will give the information to every single part of the RGB led. So in this example it would be that red will change from 80 to 00.
The reason for making it 80, instead of FF is to makes the light not hurting your eyes.
it will keep doing calculations of the steps until it reached 30(nfadesteps).
After that it prints out on the certain RGB led that given color values. It also print that information in the C-Kermit terminal.
void fadeto (int pixnum, int col1, int col2)
{
int i;
int r, g, b;
for (i=0;i <= nfadesteps;i++) {
r = interpolate (col1, col2, 16, i, nfadesteps);
g = interpolate (col1, col2, 8, i, nfadesteps);
b = interpolate (col1, col2, 0, i, nfadesteps);
printf ("pix %d %06x\n", pixnum,
(r << 16) | (g << 8) | (b << 0));
usleep (delayms*1000);
}
}
Here are the given amount of RGB leds is given. When you want to run the script you can give a value after it. ( ./randomname 20 ) When the script runs it will look if a value about one is given if it is true it will give nleds an new value.
After that the peak RGB led will become white.
int main (int argc, char **argv)
{
int nleds = 10;
int *pixels;
int pixnum, newcolor;
int i;
if (argc > 1)
nleds = atoi (argv[1]);
pixels = calloc (nleds, sizeof(int));
printf ("pix %d %06x\n", nleds, WHITE);
The for statement will count from zero till nine. Every time it counts one up it will get a random number and use a remainder that divides it to two. The result could be a zero or an one. If it is zero the color red will be given else it would be green. After that it will directly be printed, so that the for statement can count to the next number until it reached the end.
for (i=0;i < nleds;i++){
if (random () % 2 == 0)
pixels[i] = RED;
else
pixels[i] = GREEN;
printf ("pix %d %06x\n", i, pixels[i]);
}
In the while statement it has to choose a random led. It does this by giving a random number and remainder it with nleds. It will then look if the chosen RGB led is red. If that is true it will say that the newcolor it has to become is green. Else the opposite will happen. ( The RGB led will become red. ) The given values will then be send to fadeto. ( Example: (5, RED, GREEN). After that it will replace the previous color with the newcolor. so pixels[05] would become green.
while (1) {
pixnum = random () % nleds;
if (pixels[pixnum] == RED)
newcolor = GREEN;
else
newcolor = RED;
fadeto (pixnum, pixels[pixnum], newcolor);
pixels[pixnum] = newcolor;
}
exit (0);
}
[[File:RGBThree.jpg|none|400px]]
== Useful links ==
*[[usb ws2812|usb ws2812 wiki]]
*[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html PuTTY]
*[http://www.kermitproject.org/ck90.html C-Kermit]
*[http://www.columbia.edu/kermit/ckscripts.html#top C-Kermit tutorial]
*[http://www.columbia.edu/kermit/ckututor.html C-Kermit manual page and tutorial]
*[https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B C Operator list]
*[http://www.cplusplus.com/ C programming site]
2e0a810f7733bc644b60d5907ce4673b4971dfd9
File:DMX case 9.jpg
6
1966
4036
4018
2016-05-06T13:23:44Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 9.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
4045
4036
2016-05-06T13:34:19Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 9.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 1.jpg
6
1958
4037
4010
2016-05-06T13:25:29Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 1.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 2.jpg
6
1959
4038
4011
2016-05-06T13:26:40Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 2.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 3.jpg
6
1960
4039
4012
2016-05-06T13:27:47Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 3.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 4.jpg
6
1965
4040
4017
2016-05-06T13:28:39Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 4.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 5.jpg
6
1964
4041
4016
2016-05-06T13:28:52Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 5.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 6.jpg
6
1963
4042
4015
2016-05-06T13:32:08Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 6.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 7.jpg
6
1962
4043
4014
2016-05-06T13:32:17Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 7.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 8.jpg
6
1961
4044
4013
2016-05-06T13:33:46Z
Sjoerd
2544
uploaded a new version of "[[File:DMX case 8.jpg]]"
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 10.jpg
6
1969
4046
2016-05-06T13:34:43Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 11.jpg
6
1970
4047
2016-05-06T13:34:50Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 13.jpg
6
1971
4048
2016-05-06T13:35:12Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case 12.jpg
6
1972
4049
2016-05-06T13:35:25Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
File:DMX case complete.jpg
6
1973
4050
2016-05-06T13:38:19Z
Sjoerd
2544
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Assembling the DMX case
0
1967
4051
4019
2016-05-06T13:46:33Z
Sjoerd
2544
wikitext
text/x-wiki
= Assembling the DMX case =
[[File:DMX_case_complete.jpg|600px|DMX case]]
== Included ==
Included screws and washers/spacers
10x m3x6
4x m3x12
4x m2.5x10
4x m3x4mm spacer
4x m3x20mm spacer
== Step 1 ==
4x m3x6
4x m3x12
4x m3x4mm spacer
4x m3x20mm spacer
[[File:DMX_case_1.jpg|400px|DMX case - step 1]]
[[File:DMX_case_2.jpg|400px|DMX case - step 1]]
[[File:DMX_case_3.jpg|400px|DMX case - step 1]]
[[File:DMX_case_4.jpg|400px|DMX case - step 1]]
== Step 2 ==
[[File:DMX_case_5.jpg|400px|DMX case - step 2]]
[[File:DMX_case_6.jpg|400px|DMX case - step 2]]
[[File:DMX_case_7.jpg|400px|DMX case - step 2]]
== Step 3 ==
6x m3x6
4x m2.5x10
[[File:DMX_case_8.jpg|400px|DMX case - step 3]]
[[File:DMX_case_9.jpg|400px|DMX case - step 3]]
[[File:DMX_case_10.jpg|400px|DMX case - step 3]]
[[File:DMX_case_11.jpg|400px|DMX case - step 3]]
[[File:DMX_case_12.jpg|400px|DMX case - step 3]]
[[File:DMX_case_13.jpg|400px|DMX case - step 3]]
2a6bbc1b97bc0d4459e5dceb3ee9241323cd16a4
4052
4051
2016-05-06T13:46:55Z
Sjoerd
2544
/* Included */
wikitext
text/x-wiki
= Assembling the DMX case =
[[File:DMX_case_complete.jpg|600px|DMX case]]
== Included ==
Included screws and spacers
10x m3x6
4x m3x12
4x m2.5x10
4x m3x4mm spacer
4x m3x20mm spacer
== Step 1 ==
4x m3x6
4x m3x12
4x m3x4mm spacer
4x m3x20mm spacer
[[File:DMX_case_1.jpg|400px|DMX case - step 1]]
[[File:DMX_case_2.jpg|400px|DMX case - step 1]]
[[File:DMX_case_3.jpg|400px|DMX case - step 1]]
[[File:DMX_case_4.jpg|400px|DMX case - step 1]]
== Step 2 ==
[[File:DMX_case_5.jpg|400px|DMX case - step 2]]
[[File:DMX_case_6.jpg|400px|DMX case - step 2]]
[[File:DMX_case_7.jpg|400px|DMX case - step 2]]
== Step 3 ==
6x m3x6
4x m2.5x10
[[File:DMX_case_8.jpg|400px|DMX case - step 3]]
[[File:DMX_case_9.jpg|400px|DMX case - step 3]]
[[File:DMX_case_10.jpg|400px|DMX case - step 3]]
[[File:DMX_case_11.jpg|400px|DMX case - step 3]]
[[File:DMX_case_12.jpg|400px|DMX case - step 3]]
[[File:DMX_case_13.jpg|400px|DMX case - step 3]]
165e9857bf9132df7bb6842f3c3662c1c3179a2e
4053
4052
2016-05-06T13:47:23Z
Sjoerd
2544
/* Included */
wikitext
text/x-wiki
= Assembling the DMX case =
[[File:DMX_case_complete.jpg|600px|DMX case]]
== Included ==
Included screws and spacers
10x m3x6
4x m3x12
4x m2.5x10
4x m3x4mm spacer
4x m3x20mm spacer
== Step 1 ==
4x m3x6
4x m3x12
4x m3x4mm spacer
4x m3x20mm spacer
[[File:DMX_case_1.jpg|400px|DMX case - step 1]]
[[File:DMX_case_2.jpg|400px|DMX case - step 1]]
[[File:DMX_case_3.jpg|400px|DMX case - step 1]]
[[File:DMX_case_4.jpg|400px|DMX case - step 1]]
== Step 2 ==
[[File:DMX_case_5.jpg|400px|DMX case - step 2]]
[[File:DMX_case_6.jpg|400px|DMX case - step 2]]
[[File:DMX_case_7.jpg|400px|DMX case - step 2]]
== Step 3 ==
6x m3x6
4x m2.5x10
[[File:DMX_case_8.jpg|400px|DMX case - step 3]]
[[File:DMX_case_9.jpg|400px|DMX case - step 3]]
[[File:DMX_case_10.jpg|400px|DMX case - step 3]]
[[File:DMX_case_11.jpg|400px|DMX case - step 3]]
[[File:DMX_case_12.jpg|400px|DMX case - step 3]]
[[File:DMX_case_13.jpg|400px|DMX case - step 3]]
f190b870444983ca1095cb2313c843d8b2684c4d
FT4222h
0
1756
4054
3414
2016-05-16T09:48:43Z
Rew
3
/* pinout */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board. That you can buy in the [http://www.bitwizard.nl/shop/breakout-boards?product_id=150 BitWizard shop].
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
As you might expect, the two SPI connectors share the SCK, MISO and MOSI signals to the FT4222. The slave select on the two SPI connectors route to "SSO0" and "SS"
On the I2C connector you can find the I2C signals SDA (pin 2) and SCL (pin 3) as well as GND (pin 1) and VCC (pin 4). There is no pullup on the i2c lines on the board. You have to provide that externally.
The power (VCC pin) on the I2C and SPI connectors can be jumper selected between 5V and 3V3. The 5V comes from the USB connection. It should be assumed to be limted to 500mA, whereas the 3.3V comes from the FT4222 itself. The datasheet does not specify how much current can be drawn. If you use this to power "slave" circuits, you must verify that you're not drawing too much yourself.
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors. This is a solder jumper. We default the jumper to 5V with a small trace on the PCB.
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
2b79924e3b34495dcd665537ad257fda890aa1f2
Case for zero assembly
0
1974
4065
2016-06-15T15:17:09Z
Rew
3
Created page with "test"
wikitext
text/x-wiki
test
a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
Main Page
0
1
4071
3977
2016-06-20T10:35:53Z
Sjoerd
2544
DMX toegevoegd op frontpage
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= DMX =
* [[Dmx interface for raspberry pi]]
* [[Assembling the DMX case]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function on the left
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
4482d244458d01045bf0dcc9ab93895475d4e2d3
DMX
0
1975
4072
2016-06-20T14:10:09Z
Sjoerd
2544
Redirected page to [[Dmx interface for raspberry pi]]
wikitext
text/x-wiki
#REDIRECT [[Dmx_interface_for_raspberry_pi]]
09a78d29581e8c367e07b6f7f0469935c985bf9e
Dmx
0
1976
4073
2016-06-20T14:11:02Z
Sjoerd
2544
Redirected page to [[Dmx interface for raspberry pi]]
wikitext
text/x-wiki
#REDIRECT[[Dmx_interface_for_raspberry_pi]]
6730674aedde2dfb6a00b7bb0a6fdc761ed29c08
FT311D
0
1722
4078
3486
2016-07-21T12:32:04Z
Rew
3
/* External resources */
wikitext
text/x-wiki
[[File:FT311D.jpg|thumb|300px]]
This is the documentation page for the FT311D breakout board. The can be bought in the [http://www.bitwizard.nl/shop/breakout-boards/ft331d-breakout-board BitWizard shop].
== Overview ==
The FT311D breakout board has an USB connector, one 12-pin IO connector. The brains of the PCB, of course, is an FT311D chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT311D.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT311D.html FTDI product page]
* [http://www.ftdichip.com/Support/Documents/AppNotes/AN_212%20User%20Guide%20for%20FT311%20Configuration%20Utility.pdf FTDI appnote. Helps with development.]
== Using the board ==
The board can not be powered from your mobile phone, you will need to supply 5V on the 5V header pin. This will also charge your phone.
This board is compatible with AOA (Android Open Accessory), and for example the PodMode app.
== Pinout ==
The 12-pin connector is connected as follows:
<table border=1>
<tr><td>5V</td><td>3V3</td></tr>
<tr><td>USB ERROR#(jumpered)</td><td>TEST0</td></tr>
<tr><td>IOBUS6</td><td>IOBUS5</td></tr>
<tr><td>IOBUS4</td><td>IOBUS3</td></tr>
<tr><td>IOBUS2</td><td>IOBUS1</td></tr>
<tr><td>IOBUS0</td><td>GND</td></tr>
</table>
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
* The jumpers are, from left to right, for CNFG2, CNFG1, and CNFG0. Placing a jumper connects the config pin to GND, removing it leaves the pin open. Please see the datasheet for the correct jumper settings.
== Future hardware enhancements ==
* jumper to be able to disconnect the 5V header pin from the 5V USB pin
== Changelog ==
1.1
* Initial public release
2bd250086f71333ddff4c921f6f18da8f23dc0c2
Raspduino
0
1572
4079
3476
2016-08-11T13:13:14Z
Rew
3
/* Running the Project */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/shop/avr-boards/raspduino BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
=== Setup ===
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
=== Running the Project ===
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example blinky program written in Arduino Wiring can be found [https://github.com/platformio/platformio-examples/tree/develop/atmelavr-and-arduino/arduino-blink/src here]. An AVR native version is also [https://raw.githubusercontent.com/platformio/platformio-examples/develop/atmelavr-and-arduino/atmelavr-native-blink/src/main.c provided]. More can be found among the [https://github.com/platformio/platformio-examples/atmelavr-and-arduino project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
== Useful links ==
[http://www.bitwizard.nl/shop/avr-boards/raspduino The Raspduino BitWizard shop page]
64ff9a133f5d56c1c312a28b0adca6c0cdfa7968
4080
4079
2016-08-11T13:14:15Z
Rew
3
/* Running the Project */
wikitext
text/x-wiki
[[File:Raspduino_v1.1.jpg|thumb|300px|alt=The Raspduino V1.1|The Raspduino V1.1]]
This is the documentation page for the BitWizard Raspduino board. The Raspduino is an Arduino compatible microcontroller board, designed to plug on top of a Raspberry Pi (some people like to call this a Pi Plate). It is then possible to add Arduino shields to the Raspduino.<br>
<br>
The Raspduino can be bought in the [http://www.bitwizard.nl/shop/avr-boards/raspduino BitWizard shop].
= Features =
* Fully Arduino compatible
* Plugs directly on a Raspberry Pi
* Compatible with (almost) all Arduino shields
* Equipped with an ATmega328 microcontroller
* Upto 8 analog inputs
* Upto 20 digital I/O
* Breaks out the Raspberry Pi's SPI and I2C busses
= Software Installation =
== Using the Arduino IDE ==
=== Running the Setup Script ===
To be able to program the Raspduino with the Arduino IDE, you will have to add the board and the Raspberry's serial port to the arduino interface. We have created a script that will automatically apply all settings to get you going.
You can get the script [https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup here].<br>
Once you have installed the Arduino IDE, run this script as root (hint: use sudo), and you should be ready to go. You might have to reboot the Raspberry Pi to apply the settings.
If you're not familiar with linux, these are the commands you can use:
wget https://raw.github.com/rewolff/raspduino_tools/master/raspduino-setup
sudo ./raspduino-setup
sudo reboot
=== Uploading a sketch ===
If you have run our setup script, this should be pretty easy. Start up the Arduino IDE on your Raspberry Pi, select the /dev/ttyS0 serial port, and the Raspduino board (currently the bottom one), and hit the "upload" button.
== Using [http://docs.platformio.ikravets.com/en/latest/index.html PlatformIO ] ==
=== Setup ===
PlatformIO is a cross-platform code builder and project manager. It is mostly aimed at embedded development. PlatformIO can be run on an Raspberry Pi to program the RaspDuino. The main advantage is that you write both Arduino Wiring code and AVR native code. Also, it is command-line only, which is a plus for a headless Pi.
First, the serial console on /dev/ttyAMA0 should be disabled. If you dont know how to do so, run the script [[#Running the Setup Script | For setting up ]] the Arduino IDE.
Secondly, we need to install [https://pip.pypa.io/en/latest/index.html pip], the Python package manager. Since the version in the Raspbian repos is too old, we need to install from the internet:
wget -O- -q https://bootstrap.pypa.io/get-pip.py |sudo python -
For more information about pip, refer to the [https://pypi.python.org/pypi/pip homepage].
Next install PlatformIO and SCons:
sudo pip install platformio && sudo pip install --egg scons
Next, download the toolchain and programmer (this could take a while):
sudo platformio install atmelavr
Your Raspberry Pi is ready to compile and program the RaspDuino!
=== Creating a Project ===
Create a new empty directory:
mkdir myproject
Change into the newly created directory:
cd myproject
And initialize a new project:
platformio init
The project configuration file "platformio.ini" and a folder called "src" are created.
Edit platformio.ini to look like this:
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyAMA0
# enable auto-uploading
targets = upload
=== Running the Project ===
Put your source files in src/ and run
sudo platformio run
It should compile and program the RaspDuino.
An example blinky program written in Arduino Wiring can be found [https://github.com/platformio/platformio-examples/tree/develop/atmelavr-and-arduino/arduino-blink/src here]. An AVR native version is also [https://raw.githubusercontent.com/platformio/platformio-examples/develop/atmelavr-and-arduino/atmelavr-native-blink/src/main.c provided]. More can be found among the [https://github.com/platformio/platformio-examples/tree/develop/atmelavr-and-arduino project examples]. platformio.ini has to be modified in all cases to work with RaspDuino.
= Connectors and pinout =
The Raspduino of course has the same connectors and pinout as a regular Arduino, and some extra connectors.<br>
== Arduino headers ==
These are fully compatible with other Arduinos and Arduino-compatible boards. We extended the second digital connector just like on the Arduino Uno, and added the SCL and SDA pins. These are wired in parallel with Analog pins 4 and 5.
== Raspberry Pi connectors ==
The Raspberry Pi has two SPI busses, and one I2C bus. Those are (just like on our [[Raspberry_Pi_Serial]] board) broken out to their respective headers, labeled as SPI0, SPI1, and I2C. The signals on these busses are 3V3, but the inputs are 5V tolerant. With the 3V3/5V jumper, you can control what supply voltage is delivered to these connectors. The default setting is 5V.
== Power input ==
It is possible to connect an external power supply on these pins, in case you want to use your Raspduino without a Raspberry Pi.
== Extra analog connector ==
The RaspDuino has two extra analog pins (A6 and A7) provided on an extra connector located near the analog pins. The connector also provides ground and 5V (or optionally 3V3).
<table border=1>
<tr><td>1</td><td>GND</td></tr>
<tr><td>2</td><td>Analog6</td></tr>
<tr><td>3</td><td>Analog7</td></tr>
<tr><td>4</td><td>V+</td></tr>
</table>
= LEDs =
The Raspduino has two LEDs: A power indicator, and a LED connected to digital pin 13.
= Jumpers =
The Raspduino has a number of jumpers, to configure it for multiple different scenarios.
== ICSP/SPI jumper ==
It is possible to use this connector as an ICSP connector for the AVR, or an SPI connector. By default, this connector is configured as an ICSP connector, but by cutting the trace between the ICSP pad and the center pad, and shorting the center pad to the SPI pad, this connector can be used as an SPI connector. For example to control one of the [[Raspberry_pi_expansion_system_page|BitWizard SPI expansion boards]] from the Raspduino.
== I2C jumpers ==
It is possible to connect the Raspberry Pi's I2C bus to the I2C bus of the AVR. To do this, you need to short the SCL and SDA jumpers with a solder bridge.
== Serial busses voltage selection jumper ==
The 3V3/5V jumper next to the Raspberry Pi connector controls the voltage supplied to the connectors that break out the Raspberry Pi's SPI and I2C busses. It is possible to run these busses on 5V or 3V3. 5V Is the default setting, but by cutting the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge, you can set the supply voltage to 3V3.
== AVR voltage selection jumper ==
It is possible to run the AVR on 5V or 3V3 when the Raspduino is connected to a Raspberry Pi. The default setting is 5V. To set the AVR voltage to 3V3, cut the trace between the 5V pad and the center pad, and connecting the 3V3 pad to the center pad with a solder bridge. Officially the AVR cannot run at 16MHz with 3.3V supply. In practice we haven't seen any problems with running it at 16Mz on 3.3V.
= Powering the Raspduino =
You can power the Raspduino in two different ways; By the Raspberry Pi it is plugged into, or if it is used stand-alone, you can connect an external power supply to the "External Power" connector. The supply voltage should be between 7 and 15V. If the voltage is higher than 5V, it will be regulated down to 5V.
= Future hardware enhancements =
Suggestions are welcome.
= Changelog =
== 1.1 ==
* Initial public release
== Useful links ==
[http://www.bitwizard.nl/shop/avr-boards/raspduino The Raspduino BitWizard shop page]
a38a2deeae7f3cc1cf64dc9ede6b2c1ab0dadcdd
Rtc
0
1652
4081
3028
2016-08-25T06:02:28Z
Rew
3
wikitext
text/x-wiki
First, the i2c-bcm2708 i2c driver needs to be loaded. As far as I know, in the first few months of the raspberry pi being available, the module was blacklisted and didn't load automatically. Nowadays "raspi-config" will already give you the option to enable the driver.
What "raspi-config" does (but you can also do by hand) is remove the drivers from /etc/modprobe.d/raspi-blacklist.conf .
If the driver isn't loaded on your system start with:
sudo modprobe i2c-bcm2708
Then load the I2C and RTC drivers as root:
sudo -s
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
hwclock -s
Source: http://www.element14.com/community/message/63885
7b56872a8d30951c984766520313d77222c914ae
Bldc
0
1977
4082
2016-09-05T12:58:05Z
Rew
3
Created page with "To flash the latest firmware use: dfu-util -a 0 -D BLDC.dfu Get/read about dfu-util at: http://dfu-util.sourceforge.net/index.html If you're a windows user use the so..."
wikitext
text/x-wiki
To flash the latest firmware use:
dfu-util -a 0 -D BLDC.dfu
Get/read about dfu-util at:
http://dfu-util.sourceforge.net/index.html
If you're a windows user use the software at: http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-stm32080.html
b7d5cdcd56a9beb11ac5b8ef807935e36a58023b
4083
4082
2016-09-05T13:26:37Z
Rew
3
wikitext
text/x-wiki
== Flashing ==
Compared to VESC the BitWizard ESC has a neat feature: no hardware (debugger/programmer) required to perform a firmware upgrade.
To flash new firmware, connect the VESC to the USB port of your computer. Then press-and-hold the button marked "BOOT". Next press-and-release the button next to it, named "RST".
Now your ESC is in firmware-download mode.
To flash the latest firmware use:
dfu-util -a 0 -D BLDC.dfu
Get/read about dfu-util at:
http://dfu-util.sourceforge.net/index.html
If you're a windows user use the software at: http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-stm32080.html
If you are compiling your own firmware: To generate the BLDC.dfu file, use:
dfuse-pack.py -b 0x8000000:build/BLDC_4_ChibiOS.bin BLDC.dfu
in your firmware source directory.
44fb385dc31257014f0387515a5bc269732b4738
Using SPI modules with an arduino
0
1980
4086
2016-09-29T07:51:47Z
Rew
3
Created page with "= intro = It is very convenient to expand your arduino with the bitwizard I2C or SPI modules. This article focuses on the SPI variant. == hardware == To connect your bitwi..."
wikitext
text/x-wiki
= intro =
It is very convenient to expand your arduino with the bitwizard I2C or SPI modules. This article focuses on the SPI variant.
== hardware ==
To connect your bitwizard module to your arduino I prefer to use the connector on the arduino that is originally for ICSP. Almost all the SPI signals are there. And we chose the pinout to be the same as well.
The only signal that does not appear on the ICSP connector is the "slave select" signal. The ICSP connector has "RESET" there.
So use the following connection:
arduino bitwizard
ICSP SPI
1 1
2 2
3 3
4 4
6 6
[todo find the names of the signals]
This leaves SS/RESET. We cannot use the RESET line on the ICSP connector. We recommend you use the D10 pin of the arduino as that is the pin recommended for the purpose by the chip manufacturer Atmel. So:
arduino bitwizard
SPI
D10 5
== software ==
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
static unsigned char bigrelay = 0x9c;
#define WAIT1 25
#define WAIT2 15
setregval (unsigned char addr, unsigned char reg, unsigned char val)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (reg);
delayMicroseconds (WAIT2);
SPI (val);
SPI_endpkt ();
}
void setup (void)
{
int i;
SPIinit ();
pinMode (myswitch, INPUT_PULLUP);
}
void loop (void)
{
static int r;
if (digitalRead (myswitch) == 0) {
r = r + 1;
if (r == 6) r = 0;
setregval (bigrelay, 0x10, 1 << r);
delay (10); // debounce
while (digitalRead (myswitch) == 0)
/* nothing */ ;
delay (10); // debounce.
}
}
7ceb5ef6a1b51682c4eca1c16ff20b47861431d2
4087
4086
2016-09-29T07:53:11Z
Rew
3
/* software */
wikitext
text/x-wiki
= intro =
It is very convenient to expand your arduino with the bitwizard I2C or SPI modules. This article focuses on the SPI variant.
== hardware ==
To connect your bitwizard module to your arduino I prefer to use the connector on the arduino that is originally for ICSP. Almost all the SPI signals are there. And we chose the pinout to be the same as well.
The only signal that does not appear on the ICSP connector is the "slave select" signal. The ICSP connector has "RESET" there.
So use the following connection:
arduino bitwizard
ICSP SPI
1 1
2 2
3 3
4 4
6 6
[todo find the names of the signals]
This leaves SS/RESET. We cannot use the RESET line on the ICSP connector. We recommend you use the D10 pin of the arduino as that is the pin recommended for the purpose by the chip manufacturer Atmel. So:
arduino bitwizard
SPI
D10 5
== software ==
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
const int myswitch = 9;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
static unsigned char bigrelay = 0x9c;
#define WAIT1 25
#define WAIT2 15
setregval (unsigned char addr, unsigned char reg, unsigned char val)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (reg);
delayMicroseconds (WAIT2);
SPI (val);
SPI_endpkt ();
}
void setup (void)
{
int i;
SPIinit ();
pinMode (myswitch, INPUT_PULLUP);
}
void loop (void)
{
static int r;
if (digitalRead (myswitch) == 0) {
r = r + 1;
if (r == 6) r = 0;
setregval (bigrelay, 0x10, 1 << r);
delay (10); // debounce
while (digitalRead (myswitch) == 0)
/* nothing */ ;
delay (10); // debounce.
}
}
8fbbf652369d1299584a85da2f48d9c81f7b3fca
4088
4087
2016-09-29T07:55:37Z
Rew
3
/* software */
wikitext
text/x-wiki
= intro =
It is very convenient to expand your arduino with the bitwizard I2C or SPI modules. This article focuses on the SPI variant.
== hardware ==
To connect your bitwizard module to your arduino I prefer to use the connector on the arduino that is originally for ICSP. Almost all the SPI signals are there. And we chose the pinout to be the same as well.
The only signal that does not appear on the ICSP connector is the "slave select" signal. The ICSP connector has "RESET" there.
So use the following connection:
arduino bitwizard
ICSP SPI
1 1
2 2
3 3
4 4
6 6
[todo find the names of the signals]
This leaves SS/RESET. We cannot use the RESET line on the ICSP connector. We recommend you use the D10 pin of the arduino as that is the pin recommended for the purpose by the chip manufacturer Atmel. So:
arduino bitwizard
SPI
D10 5
== software ==
This example uses the BIGRELAY module, and rotates through the six relays each time you press the button.
(no relays are activated until you first press the button. )
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
const int myswitch = 9;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
static unsigned char bigrelay = 0x9c;
#define WAIT1 25
#define WAIT2 15
setregval (unsigned char addr, unsigned char reg, unsigned char val)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (reg);
delayMicroseconds (WAIT2);
SPI (val);
SPI_endpkt ();
}
void setup (void)
{
int i;
SPIinit ();
pinMode (myswitch, INPUT_PULLUP);
}
void loop (void)
{
static int r;
if (digitalRead (myswitch) == 0) {
setregval (bigrelay, 0x10, 1 << r);
delay (10); // debounce
while (digitalRead (myswitch) == 0)
/* nothing */ ;
delay (10); // debounce.
r = r + 1;
if (r == 6) r = 0;
}
}
df53af3093607615d0a3af39bae6c388320828c8
4089
4088
2016-09-29T07:55:54Z
Rew
3
/* software */
wikitext
text/x-wiki
= intro =
It is very convenient to expand your arduino with the bitwizard I2C or SPI modules. This article focuses on the SPI variant.
== hardware ==
To connect your bitwizard module to your arduino I prefer to use the connector on the arduino that is originally for ICSP. Almost all the SPI signals are there. And we chose the pinout to be the same as well.
The only signal that does not appear on the ICSP connector is the "slave select" signal. The ICSP connector has "RESET" there.
So use the following connection:
arduino bitwizard
ICSP SPI
1 1
2 2
3 3
4 4
6 6
[todo find the names of the signals]
This leaves SS/RESET. We cannot use the RESET line on the ICSP connector. We recommend you use the D10 pin of the arduino as that is the pin recommended for the purpose by the chip manufacturer Atmel. So:
arduino bitwizard
SPI
D10 5
== software ==
This example uses the BIGRELAY module, and rotates through the six relays each time you press the button.
(no relays are activated until you first press the button. )
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
const int myswitch = 9;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
static unsigned char bigrelay = 0x9c;
#define WAIT1 25
#define WAIT2 15
setregval (unsigned char addr, unsigned char reg, unsigned char val)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (reg);
delayMicroseconds (WAIT2);
SPI (val);
SPI_endpkt ();
}
void setup (void)
{
int i;
SPIinit ();
pinMode (myswitch, INPUT_PULLUP);
}
void loop (void)
{
static int r;
if (digitalRead (myswitch) == 0) {
setregval (bigrelay, 0x10, 1 << r);
delay (10); // debounce
while (digitalRead (myswitch) == 0)
/* nothing */ ;
delay (10); // debounce.
r = r + 1;
if (r == 6) r = 0;
}
}
41f5c58a49f574619f964299a9ecf400aaed24f1
Dmx interface for raspberry pi
0
1968
4090
4077
2016-10-13T08:58:09Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
3714e1f65bd405c3e11fb0a846b7e3b2a012e130
4091
4090
2016-10-21T13:15:54Z
Rew
3
/* Software */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
f17cbb6310f88b4b50078be1cd4d0bf237b2d74b
4092
4091
2016-10-22T17:03:35Z
Japidoff
2574
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio mode 18 out
gpio write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
f2a2a28d7fcd3b949db7103f749ec84c03e1d61b
4093
4092
2016-10-22T17:08:02Z
Rew
3
/* output mode */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that you can get away with forgetting about this gpio18 business if you have an older version. (I just realized I was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
d9b4c26d6a4b24d9fc1a2cec2fcb6065296cae6d
4094
4093
2016-10-22T17:09:14Z
Rew
3
/* output mode */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized /I/ was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
a26749db41a80003405c6cb9fe192a2071de13f1
4095
4094
2016-10-22T17:09:52Z
Rew
3
/* output mode */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
d7dc882065583b462d70d5a87dcc6eebd7452dd3
4096
4095
2016-10-26T06:39:47Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
aecef40ef1cf625f1d829a12fa38f5a56e8f8d0e
4097
4096
2016-10-27T00:02:49Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
5a7a2d11bc2b940e2105bbc96698b50aa3370256
4098
4097
2016-10-27T14:35:11Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''apt-get install ola'' should do the trick. The downside is however that it doesn't work :-( .
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
c0ddea896fe49fc3d819bd9b597ac26a35c8c77c
4110
4098
2016-11-21T13:24:18Z
Sjoerd
2544
/* Jessie */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-)
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
fd5c89e58e8794cd9bffed33456e98ff9ce00a89
4115
4110
2017-01-08T07:08:42Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT5 mode, if this is not the case use
gpio -g mode 14 alt5
gpio -g mode 15 alt5
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
40d95d418028cddf1571fc604aff9e26d7e985fb
4116
4115
2017-01-08T12:48:36Z
Japidoff
2574
/* output mode */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
86f318246fa21f5c21a63b7584269dc19ffe25bb
4117
4116
2017-01-08T12:52:18Z
Japidoff
2574
/* raspberry pi 3 */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyS0 on rpi3, ttyAMA0 on
others), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
7c151b98a075ddebb3d20d9b2107b2cedff2533b
4118
4117
2017-01-09T11:27:47Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
05a86e69f9b4b37640c90f2c5e8c26b65db25ded
4119
4118
2017-01-09T11:28:53Z
Rew
3
/* raspberry pi 3 */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. This is described at: http://www.raspberrypi-dmx.com/raspberry-pi-ola-dmx512-sender
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data, and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
29049699ee29ef2a0684a99639c9f58270a1b861
Usb ws2812
0
1837
4099
4021
2016-10-28T08:01:28Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== shift ===
Shift each chain one pixel towards the controller board.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
a6639ecb8ea29e2aa1269e35917c5015ffe290b3
4114
4099
2017-01-02T12:29:03Z
Rew
3
/* shift */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls 75 leds:
{| border=1
! pin !! leds
|-
| D0 || 0-74
|-
| D1 || 75-149
|-
| D2 || 150-224
|-
| D3 || 225-299
|-
| D4 || 300-374
|-
| D5 || 375-449
|-
| D6 || 450-524
|-
| D7 || 525-599
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
3469dfd784d1c93f97b154305146c0df117376c8
4124
4114
2017-01-24T16:29:49Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N"
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
32bb49e1f69f6da558070f27887eaa891f4d9df3
4125
4124
2017-01-24T16:30:17Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N"
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
87913782e2d11726af6f6dff6f6a0829ea26ce3a
4126
4125
2017-01-24T18:24:43Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have an
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
50fa4a4bfac7ca323a87ff83cacc8827b96bddb8
Main Page
0
1
4108
4071
2016-11-04T16:04:40Z
Rew
3
/* Help! */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= DMX =
* [[Dmx interface for raspberry pi]]
* [[Assembling the DMX case]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function in bar at the top (on the right).
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
1db8ae98dcaee0c5fe8bae8fa97eda6afb289b3d
Solder jumpers
0
72
4109
1231
2016-11-04T16:06:44Z
Rew
3
/* Solder jumpers */
wikitext
text/x-wiki
== Solder jumpers ==
[[File:solder_jumper_normal.JPG|none|thumb|300px|alt=Trace still intact|Trace still intact]]
Carefully(!!!) cut the narrow trace between the middle and right pad with a sharp knife:
[[File:solder_jumper_cut.JPG|none|thumb|300px|alt=Trace is cut|Trace is cut]]
Note that you can now see the bare color of the PCB, a yellowish colour. The green you know from PCBs is the solder mask that is often used.
Place a solder jumper over the other two pads:
[[File:solder_jumper_soldered.JPG|none|thumb|300px|alt=New connection is created|New connection is created]]
97e4b9a734a2e106bebd094b75c2ee20829b89fc
Field-upgrade bitwizard boards
0
1651
4112
3062
2016-12-30T13:49:49Z
Rew
3
wikitext
text/x-wiki
= Different bitwizard boards =
BitWizard now has STM32 based boards and AVR based boards. Errors in software are possible and sometimes the devices can be extended in functionality with a simple software upgrade. We therefore like to build our boards with the option of a software upgrade builtin.
Look in the right section for your board.
= AVR based boards. =
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -b 1200 -U lfuse:w:0xe2:m hfuse:w:0xdf:m
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
= STM32 based boards =
Some STM32 based boards do not have USB. In that case use the no-usb version of the upgrade procedure, otherwise skip to the with usb section.
== no usb ==
No boards with this configuration are in-the-wild yet. BitWizard internal: Look in the internal wiki documentation. :-)
== with usb ==
Our STM32 based boards with USB have a button labeled BOOT or BSEL. Press this button, keep it pressed and power up the board. Count to three and then release the button. Powering up the board is usually plugging in the USB cable. It might be easier to connect the cable to the board beforehand and power up the board by plugging the other end of the cable into a computer or USB HUB. If you have a hub with switches, that's an option too: you can throw the switch on the hub to power up our board.
Now the board should be in DFU (Device Firmware Update) mode. On Linux lsusb should show an ST microelectronics device in DFU mode. Someone with Windows may report how to navigate to a screen that shows the USB device and how to confirm DFU mode.
You should have gotten a firmware binary with .dfu extension from us.
=== Linux ===
On Linux you can now do:
dfu-util -a 0 -D ch.dfu
to upgrade the firmware in the device.
=== Windows ===
On windows ...
* download driver?
* download dfuse http://www.st.com/en/development-tools/stsw-stm32080.html
* follow instructions?
a4f947881831c3cebaab7c6c7bc77845e2af7360
4113
4112
2016-12-30T14:13:22Z
Rew
3
/* Linux */
wikitext
text/x-wiki
= Different bitwizard boards =
BitWizard now has STM32 based boards and AVR based boards. Errors in software are possible and sometimes the devices can be extended in functionality with a simple software upgrade. We therefore like to build our boards with the option of a software upgrade builtin.
Look in the right section for your board.
= AVR based boards. =
If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....
Get the modified avrdude binary from:
http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb
Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.
First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).
On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.
Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)
On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.
Then to program the board, you will have to do something like:
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328 -b 1200 -U lfuse:w:0xe2:m hfuse:w:0xdf:m
avrdude -P gpio -u -c gpio -p atmega328 -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328 -U eeprom:w:ee.hex
of course substituting the name hexfile that we sent you.
For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf
Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.
Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.
== note ==
The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc).
= STM32 based boards =
Some STM32 based boards do not have USB. In that case use the no-usb version of the upgrade procedure, otherwise skip to the with usb section.
== no usb ==
No boards with this configuration are in-the-wild yet. BitWizard internal: Look in the internal wiki documentation. :-)
== with usb ==
Our STM32 based boards with USB have a button labeled BOOT or BSEL. Press this button, keep it pressed and power up the board. Count to three and then release the button. Powering up the board is usually plugging in the USB cable. It might be easier to connect the cable to the board beforehand and power up the board by plugging the other end of the cable into a computer or USB HUB. If you have a hub with switches, that's an option too: you can throw the switch on the hub to power up our board.
Now the board should be in DFU (Device Firmware Update) mode. On Linux lsusb should show an ST microelectronics device in DFU mode. Someone with Windows may report how to navigate to a screen that shows the USB device and how to confirm DFU mode.
You should have gotten a firmware binary with .dfu extension from us.
=== Linux ===
Installing dfu-util: On modern Linux systems, you can simply do: apt-get install dfu-util , or the equivalent if your system does not use apt.
Then you can do:
dfu-util -a 0 -D ch.dfu
to upgrade the firmware in the device. (substitute the name of the binary you have if it is different).
=== Windows ===
On windows ...
* download driver?
* download dfuse http://www.st.com/en/development-tools/stsw-stm32080.html
* follow instructions?
8f40acac7afa558da84f319ba3069bccf65da776
Bridgeclock
0
1701
4120
2837
2017-01-16T20:45:22Z
Rew
3
/* normal use */
wikitext
text/x-wiki
= bridgeclock =
== features ==
* Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round".
* Easy-to-use user interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are slightly longer).
* Visible difference between "time left to change" and "time remaining in round".
* on-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running "P1" at 10 seconds left of "changetime". The ten seconds gives you time to adjust that time or to press the start/stop button to pause the clock before the first round timer starts.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by advancing the clock to the first round and pressing UP a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing start/stop.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "prog". Now + and - will select the preset-program. Press "start/stop" to start this program, or pres "prog" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the + and - keys. The changeover time is adjusted with 20 second intervals. The other two with 1 minute intervals.
Pressing "prog" will move to the next option. The changes are automatically saved for the next time.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
6eb2558c5b4332e78b80d5f329592118afe87b22
4121
4120
2017-01-16T20:57:34Z
Rew
3
/* Adjusting the clock */
wikitext
text/x-wiki
= bridgeclock =
== features ==
* Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round".
* Easy-to-use user interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are slightly longer).
* Visible difference between "time left to change" and "time remaining in round".
* on-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running "P1" at 10 seconds left of "changetime". The ten seconds gives you time to adjust that time or to press the start/stop button to pause the clock before the first round timer starts.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by advancing the clock to the first round and pressing UP a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing start/stop.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "prog". Now + and - will select the preset-program. Press "start/stop" to start this program, or pres "prog" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the + and - keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "prog" will move to the next option. The changes are automatically saved for the next time.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave.
210ebc0635242cab03609305977460aef4452d3a
4122
4121
2017-01-16T21:00:11Z
Rew
3
/* Adjusting the clock */
wikitext
text/x-wiki
= bridgeclock =
== features ==
* Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round".
* Easy-to-use user interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are slightly longer).
* Visible difference between "time left to change" and "time remaining in round".
* on-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running "P1" at 10 seconds left of "changetime". The ten seconds gives you time to adjust that time or to press the start/stop button to pause the clock before the first round timer starts.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by advancing the clock to the first round and pressing UP a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing start/stop.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "prog". Now + and - will select the preset-program. Press "start/stop" to start this program, or pres "prog" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the + and - keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "prog" will move to the next option. The changes are automatically saved for the next time.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the start/stop button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side instead of on the right), and the current value. You may adjust from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use.
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave.
9bfadfc5516d9362691ce5d43dc6cb3e7ed154dd
4123
4122
2017-01-16T21:01:28Z
Rew
3
/* Adjusting the clock */
wikitext
text/x-wiki
= bridgeclock =
== features ==
* Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round".
* Easy-to-use user interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are slightly longer).
* Visible difference between "time left to change" and "time remaining in round".
* on-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running "P1" at 10 seconds left of "changetime". The ten seconds gives you time to adjust that time or to press the start/stop button to pause the clock before the first round timer starts.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by advancing the clock to the first round and pressing UP a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing start/stop.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "prog". Now + and - will select the preset-program. Press "start/stop" to start this program, or pres "prog" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the + and - keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "prog" will move to the next option. The changes are automatically saved for the next time.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the start/stop button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use.
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave.
c06753e3b992174922fbb00bc52aab9688eed8a2
4142
4123
2017-05-20T12:10:23Z
Rew
3
/* bridgeclock */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
== features ==
* Different sounds for "end-of-round", "Warning, end-of-round is nearing" and "Start the round".
* Easy-to-use user interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* on-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the start/stop button to pause the clock before the first round timer starts.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by advancing the clock to the first round and pressing UP a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing pause.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "mode". Now up and down will select the preset-program. The programs show as P1 through P5. Press "pause" to start this program, or pres "mode" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the up and down keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "mode" will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the pause button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use.
== suggestions for use ==
The clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings,
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor.
077e11cced98f0d8b274518ad56cf97ee08f45b3
4145
4142
2017-05-26T12:05:23Z
Rew
3
/* features */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the start/stop button to pause the clock before the first round timer starts.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by advancing the clock to the first round and pressing UP a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing pause.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "mode". Now up and down will select the preset-program. The programs show as P1 through P5. Press "pause" to start this program, or pres "mode" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the up and down keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "mode" will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the pause button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use.
== suggestions for use ==
The clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings,
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor.
9b1ee86e9c6ade608b1823c72c33ef57dc173a94
4146
4145
2017-05-26T12:19:34Z
Rew
3
/* intro */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the start/stop button to pause the clock before the first round timer starts.
If during play some event causes the current round to require an extension, you can hit plus to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by advancing the clock to the first round and pressing UP a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing minus.
You can also stop (and then restart) the clock by pressing pause.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "mode". Now up and down will select the preset-program. The programs show as P1 through P5. Press "pause" to start this program, or pres "mode" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the up and down keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "mode" will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the pause button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use.
== suggestions for use ==
The clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings,
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor.
d267ef2dd3cac55832a8782394d16302a681c7c9
4147
4146
2017-05-26T12:23:19Z
Rew
3
/* normal use */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can also stop (and then restart) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "mode". Now up and down will select the preset-program. The programs show as P1 through P5. Press "pause" to start this program, or pres "mode" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the up and down keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "mode" will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the pause button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use.
== suggestions for use ==
The clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings,
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor.
6f52b3f28001199d8af727ef8085d548810f517a
4148
4147
2017-05-26T12:23:31Z
Rew
3
/* normal use */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can also stop (and then restart) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press "mode". Now up and down will select the preset-program. The programs show as P1 through P5. Press "pause" to start this program, or pres "mode" again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the up and down keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing "mode" will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the pause button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use.
== suggestions for use ==
The clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings,
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor.
4cb881b7b3206a95253ace42b49cec03f9a7708f
FT4222h
0
1756
4127
4054
2017-02-16T16:25:24Z
Rew
3
/* pinout */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board. That you can buy in the [http://www.bitwizard.nl/shop/breakout-boards?product_id=150 BitWizard shop].
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
As you might expect, the two SPI connectors share the SCK, MISO and MOSI signals to the FT4222. The slave select on the two SPI connectors route to "SSO0" and "SS"
On the I2C connector you can find the I2C signals SDA (pin 2) and SCL (pin 3) as well as GND (pin 1) and VCC (pin 4). There is no pullup on the i2c lines on the board. You have to provide that externally.
The power (VCC pin) on the I2C and SPI connectors can be jumper selected between 5V and 3V3. The 5V comes from the USB connection. It should be assumed to be limted to 500mA, whereas the 3.3V comes from the FT4222 itself. The datasheet does not specify how much current can be drawn. If you use this to power "slave" circuits, you must verify that you're not drawing too much yourself.
The 14 pin connector at the top has the following pinout:
1 - GND
2 - GND
3 - SCL
4 - SDA
5 - GPIO2
6 GPIO3
7 MOSI
8 MISO
9 IO2
10 IO3
11 SCK
12 SS0O
13 +3.3V
14 +5V.
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors. This is a solder jumper. We default the jumper to 5V with a small trace on the PCB.
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
ab086d87848ec2a17e67279e2e30a608db8aeedc
4128
4127
2017-02-17T14:55:46Z
Rew
3
/* pinout */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board. That you can buy in the [http://www.bitwizard.nl/shop/breakout-boards?product_id=150 BitWizard shop].
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
As you might expect, the two SPI connectors share the SCK, MISO and MOSI signals to the FT4222. The slave select on the two SPI connectors route to "SSO0" and "SS"
On the I2C connector you can find the I2C signals SDA (pin 2) and SCL (pin 3) as well as GND (pin 1) and VCC (pin 4). There is no pullup on the i2c lines on the board. You have to provide that externally.
The power (VCC pin) on the I2C and SPI connectors can be jumper selected between 5V and 3V3. The 5V comes from the USB connection. It should be assumed to be limted to 500mA, whereas the 3.3V comes from the FT4222 itself. The datasheet does not specify how much current can be drawn. If you use this to power "slave" circuits, you must verify that you're not drawing too much yourself.
The 14 pin connector at the top has the following pinout:
* 1 - GND
* 2 - GND
* 3 - SCL
* 4 - SDA
* 5 - GPIO2
* 6 - GPIO3
* 7 - MOSI
* 8 - MISO
* 9 - IO2
* 10 - IO3
* 11 - SCK
* 12 - SS0O
* 13 - +3.3V
* 14 - +5V.
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors. This is a solder jumper. We default the jumper to 5V with a small trace on the PCB.
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
5e73c495833a50d7c83e894e29685e42963fbc65
Raspberry Relay
0
1708
4130
3466
2017-02-25T15:09:49Z
RonanKeryell
2591
Add link to the BW_tool page
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php contact us]: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
Example using [[Bw_tool]] :
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
The SPI version has a jumper block. The pins 1,2 are marked, 3-4 are not. 1 is topright, 2 is top-left if you have the silkscreen on the board right-side-up. 1(top right) is SPI_CS0, the opposite corner (4, bottom left) is SPI_CS1. These signals can be connected to the other two with a jumper. 3, bottom-right is "board SPI CS". 2 top-left is the embedded processor's reset line. Putting a jumper 1-3 along the right of the jumper block will allow you to access the board using rapsberry pi SPI0 bus. Putting the jumper 1-2 along the top of the jumper block will allow you to flash the onboard processor, should that be needed.
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
8bb0be42dccfe4ff4f68e0a0f713b312f6654f63
4131
4130
2017-02-25T15:15:36Z
RonanKeryell
2591
Add a link to another C++14 tools for the SPI relay
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php contact us]: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
Example using [[Bw_tool]] :
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
The SPI version has a jumper block. The pins 1,2 are marked, 3-4 are not. 1 is topright, 2 is top-left if you have the silkscreen on the board right-side-up. 1(top right) is SPI_CS0, the opposite corner (4, bottom left) is SPI_CS1. These signals can be connected to the other two with a jumper. 3, bottom-right is "board SPI CS". 2 top-left is the embedded processor's reset line. Putting a jumper 1-3 along the right of the jumper block will allow you to access the board using rapsberry pi SPI0 bus. Putting the jumper 1-2 along the top of the jumper block will allow you to flash the onboard processor, should that be needed.
Another C++14 library and daemon utility for this SPI relay can be found on https://github.com/keryell/BitWizard_SPI_relay
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
5e91cf7ee28c8486f490fe33e60efa3adc38008d
Dimmer
0
1695
4134
3426
2017-04-06T13:20:22Z
Rew
3
/* Control */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found [http://www.bitwizard.nl/shop/expansion-boards/bw-dimmer here] in the shop.
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
Depending on your load, the first few values from 1-10 may not actually do something. Or they might do too much. In the past we adjusted for that, tweaking it for our test-load, but that tweaking didn't apply to other loads in the field, so we stopped doing that. The value you send is directly used by the hardware, but the lowest may result in even less output than commanded. So if you want your load to be on "low", a minimum value of "8" seems to be safe (and do very little).
Similarly, depending on your load and your mains waveform, setting values near 0xff will actually result in lower output than slightly lower values. Again this depends on lots of stuff and we can't tune it here so that the effect is totally hidden from you. Either limit yourself to a safe maximum like 0xf0, or test how far you can go and then take some margin. On my testsetup 0xfd was sometimes less bright than 0xfc. So around there is the limit so I could take some margin and use 0xf8 as the maximum value I will
When you write zero as the intensity, there will be no triggering of the triac at all, so "completely off".
=== technical stuff ===
If you don't care about the technical reasons for the above two paragraphs, skip to the next section.
The module uses a triac as the switching element. When you set the intensity to 50%, we simply trigger the triac at the top of the sinewave from the mains and the triac remains on until the next zero-crossing. Great. But at the ends different problems crop up.
When we want to trigger near the end of the half-wave, the current that starts flowing when the triac is triggered, may be below the so-called hold-current of the triac, so that the triac turns off immediately instead of conducting for a few ms (until the zero-cross) after triggering. On the other hand, we are timing the time to initiate the trigger based on the previous zero-crossing. If we measured a slightly larger value for the half-wave than what is currently happening, then we might even trigger the triac just AFTER the zero crossing. That would mean that the triac is on a whole half-wave instead of just a small part. You'll see flashes if this happens. Just use a slightly larger minimum value if this happens.
{|border=1
! address || datasize || description
|-
| 0x10 || byte || set/read intensity. 0 off. 0x08-0xf0 from low to high intensity. values outside this range at your own risk.
|-
| 0x14 || short || delta. When in a fade, use this step every 10ms. Signed 16 bit number.
|-
| 0x15 || short || fade length (remaining). Set this to non-zero to start a fade. Reads zero when the current fade is finished.
|-
|}
So far all registers are read/write. (starting version 1.2). Before 1.2 only register 10 was implemented and it could not be read back.
512e462a7f5b28199ecdd13ead2e511e102a3655
4135
4134
2017-04-06T13:20:44Z
Rew
3
/* technical stuff */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found [http://www.bitwizard.nl/shop/expansion-boards/bw-dimmer here] in the shop.
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
Depending on your load, the first few values from 1-10 may not actually do something. Or they might do too much. In the past we adjusted for that, tweaking it for our test-load, but that tweaking didn't apply to other loads in the field, so we stopped doing that. The value you send is directly used by the hardware, but the lowest may result in even less output than commanded. So if you want your load to be on "low", a minimum value of "8" seems to be safe (and do very little).
Similarly, depending on your load and your mains waveform, setting values near 0xff will actually result in lower output than slightly lower values. Again this depends on lots of stuff and we can't tune it here so that the effect is totally hidden from you. Either limit yourself to a safe maximum like 0xf0, or test how far you can go and then take some margin. On my testsetup 0xfd was sometimes less bright than 0xfc. So around there is the limit so I could take some margin and use 0xf8 as the maximum value I will
When you write zero as the intensity, there will be no triggering of the triac at all, so "completely off".
=== technical stuff ===
If you don't care about the technical reasons for the above two paragraphs, skip to the next section.
The module uses a triac as the switching element. When you set the intensity to 50%, we simply trigger the triac at the top of the sinewave from the mains and the triac remains on until the next zero-crossing. Great. But at the ends different problems crop up.
When we want to trigger near the end of the half-wave, the current that starts flowing when the triac is triggered, may be below the so-called hold-current of the triac, so that the triac turns off immediately instead of conducting for a few ms (until the zero-cross) after triggering. On the other hand, we are timing the time to initiate the trigger based on the previous zero-crossing. If we measured a slightly larger value for the half-wave than what is currently happening, then we might even trigger the triac just AFTER the zero crossing. That would mean that the triac is on a whole half-wave instead of just a small part. You'll see flashes if this happens. Just use a slightly larger minimum value if this happens.
=== protocol ===
{|border=1
! address || datasize || description
|-
| 0x10 || byte || set/read intensity. 0 off. 0x08-0xf0 from low to high intensity. values outside this range at your own risk.
|-
| 0x14 || short || delta. When in a fade, use this step every 10ms. Signed 16 bit number.
|-
| 0x15 || short || fade length (remaining). Set this to non-zero to start a fade. Reads zero when the current fade is finished.
|-
|}
So far all registers are read/write. (starting version 1.2). Before 1.2 only register 10 was implemented and it could not be read back.
1aa87f41366141b66959bc2754c1d498ce51dccf
4136
4135
2017-04-06T13:37:15Z
Rew
3
/* protocol */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found [http://www.bitwizard.nl/shop/expansion-boards/bw-dimmer here] in the shop.
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
Depending on your load, the first few values from 1-10 may not actually do something. Or they might do too much. In the past we adjusted for that, tweaking it for our test-load, but that tweaking didn't apply to other loads in the field, so we stopped doing that. The value you send is directly used by the hardware, but the lowest may result in even less output than commanded. So if you want your load to be on "low", a minimum value of "8" seems to be safe (and do very little).
Similarly, depending on your load and your mains waveform, setting values near 0xff will actually result in lower output than slightly lower values. Again this depends on lots of stuff and we can't tune it here so that the effect is totally hidden from you. Either limit yourself to a safe maximum like 0xf0, or test how far you can go and then take some margin. On my testsetup 0xfd was sometimes less bright than 0xfc. So around there is the limit so I could take some margin and use 0xf8 as the maximum value I will
When you write zero as the intensity, there will be no triggering of the triac at all, so "completely off".
=== technical stuff ===
If you don't care about the technical reasons for the above two paragraphs, skip to the next section.
The module uses a triac as the switching element. When you set the intensity to 50%, we simply trigger the triac at the top of the sinewave from the mains and the triac remains on until the next zero-crossing. Great. But at the ends different problems crop up.
When we want to trigger near the end of the half-wave, the current that starts flowing when the triac is triggered, may be below the so-called hold-current of the triac, so that the triac turns off immediately instead of conducting for a few ms (until the zero-cross) after triggering. On the other hand, we are timing the time to initiate the trigger based on the previous zero-crossing. If we measured a slightly larger value for the half-wave than what is currently happening, then we might even trigger the triac just AFTER the zero crossing. That would mean that the triac is on a whole half-wave instead of just a small part. You'll see flashes if this happens. Just use a slightly larger minimum value if this happens.
=== protocol ===
{|border=1
! address || datasize || description
|-
| 0x10 || byte || set/read intensity. 0 off. 0x08-0xf0 from low to high intensity. values outside this range at your own risk.
|-
| 0x14 || short || delta. When in a fade, use this step every 10ms. Signed 16 bit number.
|-
| 0x15 || short || fade length (remaining). Set this to non-zero to start a fade. Reads zero when the current fade is finished.
|-
|}
So far all registers are read/write. (starting version 1.2). Before 1.2 only register 10 was implemented and it could not be read back.
=== fades ===
For a fade, the intensity is kept with 8 bits after the binary point. The delta, also with 8 bits after the binary point is added to the current intensity each 10ms (each half-period).
=== Calculating a fade ===
If you want to take 10 seconds or 1000 steps, to go from 0x40 to 0xc0, you calculate the difference to be 0x80 or 128. This means that you need a total of 128*256 (8 binary bits behind the binary point) = 32768 total added to your extended (8bits behind the point) intensity value. So you need 32768/1000 = 32 or 33 added per time tick. You can adjust for the last few values that by adjusting the length after the fade.
If you want to start a new fade right after the current fade, poll the fade length register say at 500ms intervals. When below 500ms (a value of 50 decimal returned), you schedule a sleep from 10ms * the returned number, so that you are woken near the time that the fade runs to an end.
65855dccc5630f5599b2fab0291c3f332a1aba7d
4137
4136
2017-04-06T17:16:23Z
Rew
3
/* Calculating a fade */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found [http://www.bitwizard.nl/shop/expansion-boards/bw-dimmer here] in the shop.
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
Depending on your load, the first few values from 1-10 may not actually do something. Or they might do too much. In the past we adjusted for that, tweaking it for our test-load, but that tweaking didn't apply to other loads in the field, so we stopped doing that. The value you send is directly used by the hardware, but the lowest may result in even less output than commanded. So if you want your load to be on "low", a minimum value of "8" seems to be safe (and do very little).
Similarly, depending on your load and your mains waveform, setting values near 0xff will actually result in lower output than slightly lower values. Again this depends on lots of stuff and we can't tune it here so that the effect is totally hidden from you. Either limit yourself to a safe maximum like 0xf0, or test how far you can go and then take some margin. On my testsetup 0xfd was sometimes less bright than 0xfc. So around there is the limit so I could take some margin and use 0xf8 as the maximum value I will
When you write zero as the intensity, there will be no triggering of the triac at all, so "completely off".
=== technical stuff ===
If you don't care about the technical reasons for the above two paragraphs, skip to the next section.
The module uses a triac as the switching element. When you set the intensity to 50%, we simply trigger the triac at the top of the sinewave from the mains and the triac remains on until the next zero-crossing. Great. But at the ends different problems crop up.
When we want to trigger near the end of the half-wave, the current that starts flowing when the triac is triggered, may be below the so-called hold-current of the triac, so that the triac turns off immediately instead of conducting for a few ms (until the zero-cross) after triggering. On the other hand, we are timing the time to initiate the trigger based on the previous zero-crossing. If we measured a slightly larger value for the half-wave than what is currently happening, then we might even trigger the triac just AFTER the zero crossing. That would mean that the triac is on a whole half-wave instead of just a small part. You'll see flashes if this happens. Just use a slightly larger minimum value if this happens.
=== protocol ===
{|border=1
! address || datasize || description
|-
| 0x10 || byte || set/read intensity. 0 off. 0x08-0xf0 from low to high intensity. values outside this range at your own risk.
|-
| 0x14 || short || delta. When in a fade, use this step every 10ms. Signed 16 bit number.
|-
| 0x15 || short || fade length (remaining). Set this to non-zero to start a fade. Reads zero when the current fade is finished.
|-
|}
So far all registers are read/write. (starting version 1.2). Before 1.2 only register 10 was implemented and it could not be read back.
=== fades ===
For a fade, the intensity is kept with 8 bits after the binary point. The delta, also with 8 bits after the binary point is added to the current intensity each 10ms (each half-period).
=== Calculating a fade ===
If you want to take 10 seconds or 1000 steps, to go from 0x40 to 0xc0, you calculate the difference to be 0x80 or 128. This means that you need a total of 128*256 (8 binary bits behind the binary point) = 32768 total added to your extended (8bits behind the point) intensity value. So you need 32768/1000 = 32 or 33 added per time tick. You can adjust for the last few values that by adjusting the length after the fade.
If you want to start a new fade right after the current fade, poll the fade length register say at 500ms intervals. When below 500ms (a value of 50 decimal returned), you schedule a sleep from 10ms * the returned number, so that you are woken near the time that the fade runs to an end.
== Examples using bw_tool ==
To put the dimmer on 0x40 (quarter)
bw_tool -a 9e -W 10:40:b
then to fade to 0xc0 (three quarters)
bw_tool -a 9e -W 14:20:s 15:400:s
and then back:
bw_tool -a 9e -W 14:ffe0:s 15:400:s
c94c409741e94c4fae6ea30ddf65c47f8f583974
4138
4137
2017-04-08T06:43:25Z
Rew
3
/* Calculating a fade */
wikitext
text/x-wiki
[[File:Dimmer small.jpg|thumb|300px|The dimmer]]
== Overview ==
The dimmer can be used to control the intensity of lights. It works the same as regular dimmers that can be bought in any other hardware shop, but can be controlled over I2C. It should work with any I2C-capable device, including the Raspberry Pi, Arduino and many other microcontrollers.
The dimmer can be found [http://www.bitwizard.nl/shop/expansion-boards/bw-dimmer here] in the shop.
== Control ==
The dimmer is at I2C address 0x9E. Port 0x10 is the intensity. The value written can be between 0 and 255, where 0 is the lowest intensity and 255 is the highest intensity.
With [[bw_tool]] it can be controlled like this:
bw_tool -I -D /dev/i2c-1 -a 9e -W 10:xx:b
Where xx is the intensity in hex. (i.e. 00-ff, 80 is "half", 40 is "quarter" intensity).
Depending on your load, the first few values from 1-10 may not actually do something. Or they might do too much. In the past we adjusted for that, tweaking it for our test-load, but that tweaking didn't apply to other loads in the field, so we stopped doing that. The value you send is directly used by the hardware, but the lowest may result in even less output than commanded. So if you want your load to be on "low", a minimum value of "8" seems to be safe (and do very little).
Similarly, depending on your load and your mains waveform, setting values near 0xff will actually result in lower output than slightly lower values. Again this depends on lots of stuff and we can't tune it here so that the effect is totally hidden from you. Either limit yourself to a safe maximum like 0xf0, or test how far you can go and then take some margin. On my testsetup 0xfd was sometimes less bright than 0xfc. So around there is the limit so I could take some margin and use 0xf8 as the maximum value I will
When you write zero as the intensity, there will be no triggering of the triac at all, so "completely off".
=== technical stuff ===
If you don't care about the technical reasons for the above two paragraphs, skip to the next section.
The module uses a triac as the switching element. When you set the intensity to 50%, we simply trigger the triac at the top of the sinewave from the mains and the triac remains on until the next zero-crossing. Great. But at the ends different problems crop up.
When we want to trigger near the end of the half-wave, the current that starts flowing when the triac is triggered, may be below the so-called hold-current of the triac, so that the triac turns off immediately instead of conducting for a few ms (until the zero-cross) after triggering. On the other hand, we are timing the time to initiate the trigger based on the previous zero-crossing. If we measured a slightly larger value for the half-wave than what is currently happening, then we might even trigger the triac just AFTER the zero crossing. That would mean that the triac is on a whole half-wave instead of just a small part. You'll see flashes if this happens. Just use a slightly larger minimum value if this happens.
=== protocol ===
{|border=1
! address || datasize || description
|-
| 0x10 || byte || set/read intensity. 0 off. 0x08-0xf0 from low to high intensity. values outside this range at your own risk.
|-
| 0x14 || short || delta. When in a fade, use this step every 10ms. Signed 16 bit number.
|-
| 0x15 || short || fade length (remaining). Set this to non-zero to start a fade. Reads zero when the current fade is finished.
|-
|}
So far all registers are read/write. (starting version 1.2). Before 1.2 only register 10 was implemented and it could not be read back.
=== fades ===
For a fade, the intensity is kept with 8 bits after the binary point. The delta, also with 8 bits after the binary point is added to the current intensity each 10ms (each half-period).
=== Calculating a fade ===
If you want to take 10 seconds or 1000 steps, to go from 0x40 to 0xc0, you calculate the difference to be 0x80 or 128. This means that you need a total of 128*256 (8 binary bits behind the binary point) = 32768 total added to your extended (8bits behind the point) intensity value. So you need 32768/1000 = 32 or 33 added per time tick. You can adjust for the last few values that by adjusting the length after the fade.
If you want to start a new fade right after the current fade, poll the fade length register say at 500ms intervals. When below 500ms (a value of 50 decimal returned), you schedule a sleep from 10ms * the returned number, so that you are woken near the time that the fade runs to an end.
Another way to think about this is to think of the dimmer setting as a 16 bit integer 0-65535. For a fade you instruct the device to add a value to the current value every 10 milliseconds for a certain number of steps. In the example below I started out with a fade of 32 (0x20) and rounded off the "1000" (0x3e8) to 1024 (0x400) because it was easier in Hex. But now the fade comes out exactly: 32*1024=32786 (0x20 * 0x400 = 0x8000).
== Examples using bw_tool ==
To put the dimmer on 0x40 (quarter)
bw_tool -a 9e -W 10:40:b
then to fade to 0xc0 (three quarters)
bw_tool -a 9e -W 14:20:s 15:400:s
and then back:
bw_tool -a 9e -W 14:ffe0:s 15:400:s
94818a9a4949a2da164584ecea128b0dce827e3b
DIO protocol
0
432
4140
3759
2017-05-19T10:03:54Z
Rew
3
/* Using the digital ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output. (Read: Using the digital ports)
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc. (Read: Using the digital ports)
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. It is if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
== BitMask value for every pin ==
{| border=1
! Pin !! Function !! Value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
When a bit is defined as "input", you can use the data register (0x10) to configure the pullup on the pin. So if you write a 0 to a bit there, the corresponding pin will float, and can very easily be driven high or low. (max load by the chip: 1 micro amp). If you write a 1 there, the chip will drive a weak pullup of about 50k. This is useful to connect a switch for example. The switch goes from the pin to ground, and you activate the pullup to define the pin as "high" when the switch is not activated.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
c009cde1441405c5c31bebfce69651dc36dca6de
4141
4140
2017-05-19T10:04:15Z
Rew
3
/* BitMask value for every pin */
wikitext
text/x-wiki
= Introduction =
The protocol for the DIO, 3FETs, 7FETs, RELAY, BIGRELAY and Pushbutton will be explained on this page. Most functions apply to all boards, but some don't.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
Please see [[Default_addresses|this]] page for the default addresses.
= Write Ports =
On the DIO and related boards all ports just set a single value. So writing more than one byte to such a port is redundant. The last value is the one used. The DIO boards don't have any ports that are logically a stream of bytes. So writing more than one or two bytes is not encouraged.
The DIO, 3FETS and 7FETS boards define several ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY and BIGRELAY !! pushbutton
|-
| 0x10 || X || X || X || || set all outputs (bit 0 is output 0, etc).
|-
| 0x20 .. 0x26 || X || X || X || || set one output (0x20 for output 0, 0x21 for output 1 etc)
|-
| 0x30 || X || X || X || || define pins as inputs or outputs. 0 means input, 1 means output. (Read: Using the digital ports)
|-
| 0x40 || X || X || || || set current position. (32 bits) The current position will be "renamed" to the given value. No motor movement will occur.
|-
| 0x41 || X || X || || || set target position. (32 bits) The motor will start stepping (hopefully in the rigth direction) to go to this position. You can read the current position to see if it has arrived yet.
|-
| 0x42 || X || X || || || set relative position. (32 bits) The target position is adjusted with this number.
|-
| 0x43 || X || X || || || set stepdelay. (in tenths of a microsecond, default 200: 20ms between steps). (8bits)
|-
| 0x50 .. 0x56 || v1.1 and up || X || || || Set PWM value. 0x50: output 0, 0x51 output 1 etc. (Read: Using the digital ports)
|-
| 0x5f || v1.1 and up || X || || || Set PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to enable PWM on output 0
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Select which i/o is coupled to which ADC channel. See [[analog inputs]]
|-
| 0x80 || v1.2 and up || || || || Set number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Set number of samples to add (we suggest using a power of 2) (two bytes)
|-
| 0x82 || v1.2 and up || || || || Set number of bits to shift accumulated sample value
|-
| 0xf0 || X || X || X || X || change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || X || X || X || X || write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || X || X || X || X || write 0xaa here to unlock the change address register.
|}
All the above ports are read/write. It is if you read from that port, you will get the current value.
= Read Ports =
The DIO, 3FETS, and 7FETS boards support the following read ports:
{| border=1
!rowspan="2"|port !!colspan="4"|available on !!rowspan="2"|function
|-
! DIO !! 3/7FETs !! RELAY !! pushbutton
|-
| 0x01 || X || X || X || X || identification string. (terminated with 0).
|-
| 0x02 || X || X || X || X || read eeprom (serial number).
|-
| 0x10 || X || X || X || X || read all inputs
|-
| || || || || || registers 0x14 - 0x17: Implemented in DIO 1.5 and up.
|-
| 0x14 || X || || || || "hasbeenlow". The signal has been seen "low" since you last read this register.
|-
| 0x15 || X || || || || "hasbeenhigh". The signal has been seen "high" since you last read this register.
|-
| 0x16 || X || || || || "hasgoneup" the signal has been seen to transition "UP" since you last read this register.
|-
| 0x17 || X || || || || "hasgonedown" the signal has been seen to transition "DOWN" since you last read this register.
|-
| 0x20 .. 0x26 || X || || || X || read one input (0x20 for input 0, 0x21 for input 1 etc)
|-
| 0x40 || X || X || || || read current position.
|-
| 0x41 || X || X || || || read target position.
|-
| 0x43 || X || X || || || read stepdelay. (in tenths of a microsecond, default 200: 20ms between steps).
|-
| 0x50 || v1.1 and up || X || || || Return PWM value for output 0
|-
| 0x51 || v1.1 and up || X || || || Return PWM value for output 1
|-
| 0x52 || v1.1 and up || X || || || Return PWM value for output 2
|-
| 0x53 || v1.1 and up || X || || || Return PWM value for output 3
|-
| 0x54 || v1.1 and up || X || || || Return PWM value for output 4
|-
| 0x55 || v1.1 and up || X || || || Return PWM value for output 5
|-
| 0x56 || v1.1 and up || X || || || Return PWM value for output 6
|-
| 0x5f || v1.1 and up || X || || || Return PWM mask. PWM is enabled on the outputs, who's bit is high. send 0x01 as data, to read PWM on output 0
|-
| 0x60.. 0x66 || v1.2 and up || || || || Return analog value (2 bytes)
|-
| 0x68 .. 0x6f || v1.2 and up || || || || Return added and bitshifted analog value (2 bytes)
|-
| 0x70 .. 0x76 || v1.2 and up || || || || Return which i/o is coupled to which ADC channel
|-
| 0x80 || v1.2 and up || || || || Return number of ADC channels to read
|-
| 0x81 || v1.2 and up || || || || Return number of samples to add (two bytes)
|-
| 0x82 || v1.2 and up || || || || Return number of bits to shift accumulated sample value
|}
= Using the digital ports =
Before using a port as an output, you have to set the "data direction register". This is done by writing to port 0x30. For the first output, the lowest bit has to be "1". For the second output the next bit and so on. So value 0x01 defines only "output 0" as an output, the other as inputs. The value 0xff will make all pins outputs. Register 0x5F (PWM mask) is also a bitmask and works in the same way. For "dio" the pins will all default to inputs, to prevent bus contention if another source is driving the pin.
For boards that only have outputs, like 3fets, 7fets, relay and bigrelay, the firmware will now default all the pins to outputs. However some early versions didn't have that yet. So we recommend that you still explicitly make the signals into outputs in your code. So we recommend that you send a 0xff to register 0x30 in the initialization sequence.
== BitMask value for every pin ==
{| border=1
! Pin !! Function !! Value
|-
| 3 || IO0 || 01
|-
| 4 || IO1 || 02
|-
| 5 || IO2 || 04
|-
| 6 || IO3 || 08
|-
| 8 || IO4 || 10
|-
| 9 || IO5 || 20
|-
| 10 || IO6 || 40
|}
=== inputs and pullups ===
When a bit is defined as "input", you can use the data register (0x10) to configure the pullup on the pin. So if you write a 0 to a bit there, the corresponding pin will float, and can very easily be driven high or low. (max load by the chip: 1 micro amp). If you write a 1 there, the chip will drive a weak pullup of about 50k. This is useful to connect a switch for example. The switch goes from the pin to ground, and you activate the pullup to define the pin as "high" when the switch is not activated.
= Using the analog inputs =
== Taking measurements ==
The built-in ADC has 10 bits of resolution, and can be read in two different ways:<br>
* Just read the latest sample
* Add x samples, and optionally bitshift the result by n bits.
The first option is easy, but prone to some noise.
The second option gives you the ability to reduce the noise and/or obtain higher resolution.
To take the average of a number of samples, set the "nsamp" (0x81) register to 2^n, and set the shift (0x82) register to n. This tells the controller to sum 2^n samples, and then divide by 2^n, resulting in the average value, which can be read from registers 0x68 .. 0x6f, depending on the channel.
For more than 10 bits of precision, it's possible to skip the bitshifting. In theory, this gives you a higher accuracy than the ADC's 10 bits. To do this, set register 0x81 to 2^n, and set register 0x82 to 0. The result can then be read from registers 0x68 .. 0x6f, depending on the channel. Do take note that statisticians have proven that you gain only n/2 of significant bits this way.
You can set nsamp (register 0x81) to 4096 (0x1000 = 2^12), and then the shift register (0x82) to 6. This will give you a 16bit results with about 16 bits of significance. The performance is such that you can get an update about every second in this mode. This is ideal for things like temperature readings.
== Setting up the ADC ==
First decide which i/o pins you want to use as analog inputs, and which i/o pin is analog 0, 1, etc. These settings need to be written to registers 0x70 .. 0x76, 0x70 being analog0, and 0x76 being analog6. The following values are valid:
{| border=1
! IO pin !! value
|-
| 0 || 0x07
|-
| 1 || 0x03
|-
| 2 || analog not available
|-
| 3 || 0x02
|-
| 4 || 0x01
|-
| 5 || analog not available
|-
| 6 || 0x00
|}
The measurements are done with the 5V power supply rail as the "full scale" reference voltage. You can use an internal 1.1V reference voltage by adding 0x80 to the values in the table above.
Now decide how you want to sample the analog values, and set those registers.
Finally, you need to write the amount of analog channels you want to use to register 0x80. The controller wil now start sampling those channels.
=== ADC Example ===
We want to use IO 4 and IO 0 for reading analog values, and want an average value over 16 samples. To do this, we need to send the following commands:
{| border=1
! command !! explanation
|-
| 0x84 0x70 0x01 || Couple ADC channel 0 to IO4
|-
| 0x84 0x71 0x07 || Couple ADC channel 1 to IO0
|-
| 0x84 0x81 0x00 0x01 || Add 256 (2^8) samples
|-
| 0x84 0x82 0x04 || Bitshift result by 4 bits
|-
| 0x84 0x80 0x02 || Set number of channels to sample to 2
|}
Now you can read from ADC channel 0 and 1:
{| border=1
! command !! explanation
|-
| 0x85 0x68 0xXX 0xXX || read channel 0, for SPI send the bytes XX, get the data on the MISO line. For I2C, just read two bytes after sending the other bytes.
|-
| 0x85 0x69 0xXX 0xXX || read channel 1.
|}
== PWM Example ==
We want to use IO 4 and IO 0 for PWM, and then set IO 0 to 20% and IO4 to 50%:
{| border=1
! command !! explanation
|-
| 0x84 0x5f 0x11 || bitmask of the IOs that use PWM: Add 0x01 for IO0 and 0x10 for IO4.
|-
| 0x84 0x50 0x33 || 20% of 255 is 51 = 0x33.
|-
| 0x84 0x54 0x80 || 50% of 255 is 128 = 0x80.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. (SPI_DIO)
{| border=1
! data sent !! data received || explanation
|-
| 0x85 || xx || select destination with address 0x84 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
read the identification string of the board. (I2C_DIO)
{| border=1
! I2C master !! I2C slave (i2c_dio)|| explanation
|-
| START || -- || start I2C transaction
|-
| 0x84 || -- || select destination with address 0x84 for write (set port).
|-
| 0x01 || -- || identify
|-
| STOP || -- || terminate I2C transaction.
|-
|
|-
| START || -- || start I2C transaction
|-
| 0x85 || -- || select destination with address 0x84 for READ.
|-
| -- || 0x69 || 'i'
|-
| -- || 0x32 || '2'
|-
| -- || 0x63 || 'c'
|-
| -- || ... || etc.
|}
Note that in the SPI example, there is bidirectional datatransfer on every cycle, but the data is "don't care" or "must ignore" (indicated by xx), while in the I2C case, the other side cannot send as there is only one data-transfer direction (indicated by "--").
== Turn on all outputs ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x10 || xx || set outputs as in bitpattern (next byte)
|-
| 0xff || xx || All outputs active.
|}
== Turn on output 4 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x24 || xx || port 0x24: output 4...
|-
| 0xff || xx || ... active.
|}
== Move stepper to step 0x1234 ==
{| border=1
! data sent !! data recieved || explanation
|-
| 0x88 || xx || select destination with address 0x88 for WRITE
|-
| 0x41 || xx || port 0x41: set target position
|-
| 0x34 || xx || low byte
|-
| 0x12 || xx || high byte.
|}
== Example script for rpi ==
This script assumes that you have "bw_tool" installed on your rpi. Actually, it will work on any Linux machine that has I2C support.
This script moves a single "on" state back and forth along the outputs. If you connect a "[[16 LEDs|DIO_LEDS]]", you'll see the led move up and down (as my DIO is currently mounted vertically.... Most people might lay the board down on their desk, so that would become left-and-right.. :-) ).
#!/bin/sh
t=0.1
addr=84
dio="bw_tool -I -D /dev/i2c-1 -a $addr "
#
# Set all pins as outputs.
$dio -W 30:ff:b
#
while true ; do
# I'm lazy. didn't write a proper loop. Sorry.
$dio -W 10:01:b
sleep $t
$dio -W 10:02:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:40:b
sleep $t
$dio -W 10:20:b
sleep $t
$dio -W 10:10:b
sleep $t
$dio -W 10:08:b
sleep $t
$dio -W 10:04:b
sleep $t
$dio -W 10:02:b
sleep $t
done
== Arduino example sketch: I2C ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses "Wire" or I2C. See below for an SPI example for arduino.
#include <Wire.h>
#define ADDR (0x84/2)
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
Wire.beginTransmission(addr); // transmit to device #4
Wire.write(reg); // sends five bytes
Wire.write(val); // sends one byte
Wire.endTransmission(); // stop transmitting
}
void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
//bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
}
#define LED 13
void loop()
{
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
== Arduino example sketch: SPI ==
Again, a single "on" state moves back and forth across the 7 outputs. I have a [[16 LEDs|DIO_LEDS]] connected and see the led move back and forth.
This sketch uses SPI. This sketch runs like this on an STM32F103 board. Thus, on a normal AVR based ARDUINO you'll have to set "SLAVESELECT" to "13" (IIRC). As the LED is also on digital pin 13, the flashing led on the board is not possible on a standard arduino. Remove the two lines in the "loop" function if the led clashes with the slave select.
#include "SPI.h"
#define DELAY 10
#define ADDR (0x84)
#define SLAVESELECT 18
void bw_write_reg (unsigned char addr, unsigned char reg, unsigned char val)
{
digitalWrite(SLAVESELECT, LOW);
delayMicroseconds (DELAY);
SPI.transfer(addr); //Send register location
delayMicroseconds (DELAY);
SPI.transfer(reg); //Send value to record into register
delayMicroseconds (DELAY);
SPI.transfer(val); //Send value to record into register
delayMicroseconds (DELAY);
digitalWrite(SLAVESELECT, HIGH);
}
void setup() {
// put your setup code here, to run once:
SPI.begin ();
SPI.setClockDivider(SPI_CLOCK_DIV64);
pinMode (SLAVESELECT, OUTPUT);
bw_write_reg (ADDR, 0x30, 0xff); // set all pins as outputs.
bw_write_reg (ADDR, 0x30, 0x00); // Just use the pullups: My leds are too bright.
pinMode (LED, OUTPUT);
}
#define LED 25
void loop() {
// put your main code here, to run repeatedly:
static int t;
if (t < 7) bw_write_reg (ADDR, 0x10, 1 << t);
else bw_write_reg (ADDR, 0x10, 0x40 >> (t-7));
if (t++ == 12) t = 0;
digitalWrite (LED, t&1);
delay(100);
}
c167313cbafb240781cb0237c645d22a1b1705e1
Bridgeclock
0
1701
4149
4148
2017-05-26T12:26:28Z
Rew
3
/* Adjusting the clock */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can also stop (and then restart) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use. During daytime or outside even brighter might be useful.
== suggestions for use ==
The clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings,
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor.
8e5718d7afe81922b26f86ebe07eb62fc488187e
4150
4149
2017-05-26T12:32:13Z
Rew
3
/* suggestions for use */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can also stop (and then restart) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use. During daytime or outside even brighter might be useful.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor.
fd28b54025f7587f2e68c026a7aaf7cc4685331f
4151
4150
2017-05-26T12:34:27Z
Rew
3
/* technical details */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can also stop (and then restart) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use. During daytime or outside even brighter might be useful.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of may 2017 nobody but me has version 2 hardware).
3d882f95b8e42eb72a3e80d03347769eee8dacba
4152
4151
2017-05-26T12:34:55Z
Rew
3
/* feature requests */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can also stop (and then restart) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the + and - buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use. During daytime or outside even brighter might be useful.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of may 2017 nobody but me has version 2 hardware).
1c127605f964fda07010f15af4a987de68bf2c08
4153
4152
2017-05-26T13:19:24Z
Rew
3
/* Adjusting the clock */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds gives you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute. If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can also stop (and then restart) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use. During daytime or outside even brighter might be useful.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of may 2017 nobody but me has version 2 hardware).
f3b5eb23f24ecb5c99ffd23beeaf53bfa51b2945
4156
4153
2017-05-28T08:58:18Z
Rew
3
/* Normal use */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds give you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can stop (and then resume) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, 30 seems good for normal use. During daytime or outside even brighter might be useful.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of may 2017 nobody but me has version 2 hardware).
f8fa73af398281e25b77120402eb2e380387a152
4157
4156
2017-05-28T09:20:48Z
Rew
3
/* Adjusting the clock */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds give you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can stop (and then resume) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of may 2017 nobody but me has version 2 hardware).
42fec12e4bc06e754ec2598927078425d3b255c0
4158
4157
2017-05-28T09:23:21Z
Rew
3
/* Normal use */
wikitext
text/x-wiki
= bridgeclock =
== intro ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we built one. We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we built what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought.
Also, if you think a unit with four big numbers like this is useful in another context, the hardware may already be capable, we might be able to adapt the software for another setting. So if you have an idea, let us know.
== features ==
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Easy-to-use interface for adjustments.
* Big display.
* Preset programs. Allow you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Visible difference between "time left to change" and "time remaining in round".
* On-the-fly adjustment of the playing and changeover time.
== Normal use ==
The bridgeclock is simple to use. Just plug it in, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". The ten seconds give you time to adjust that time or to press the '''pause''' button to pause the clock before the first round timer starts.
If you want the first round to be longer than the rest (e.g. to allow people to get settled or to allow them to deal the cards) you can also do that by allowing the clock to advance to the first round and pressing '''up''' a few times.
If during play (or change time) some event causes the current round to require an extension, you can simply hit '''up''' to increase the current time by one minute.
Similarly, if e.g. you find everybody is ready for the next round, you can decrease the time by one minute by pressing '''down'''.
You can stop (and then resume) the clock by pressing '''pause'''.
A warning sounds (by default 5 minutes) before the end of each round.
A different warning sounds at the end of the round.
The clock will then animate the first digit to indicate that it is time to change tables. This allows users to see the difference between "2 minutes left to change" and "2 minutes left in this round".
A third sound is produced when the next round starts.
After play it is recommended to turn off the on/off switch on the side and unplug the adapter. If you want to leave the switch in the on position and just unplug the adapter that's fine too.
== Adjusting the clock ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start this program, or press '''mode''' again to make adjustments to this program.
For each program there are three settings: time to play, warning time, and changeover time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. The changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the intensity of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (different from the "1" because it is on the left side of the digit instead of on the right), and the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Feature requests ==
As mentioned above, we welcome feature requests. No guarantees that we can implement them, but we love to hear them.
Features that have already been requested and are slowly being implemented are:
* multiple clocks in master-slave configuration.
* remote control.
So if you want that, on the one hand, we already know that and we're working on it. On the other hand, if you do let us know, we might be able to let you know when we've implemented it. And it allows us to know how many people are waiting for such a feature....
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs from 15V. Not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
If you open up the clock, there is a small blue-and-white pot to adjust the volume.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (Hmm. V2 hardware might end up with a V1 slave PCB as the master/slave interface is the same).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of may 2017 nobody but me has version 2 hardware).
e4bd4ea447436881c6abe7098e2e2d495de9e5c8
4195
4158
2017-08-22T16:18:00Z
Daniel L
2607
/* bridgeclock */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge sitting consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal is sounded when the end of a round approaches, a different signal is sounded at the end of a round, and a third signal is sounded when the break time is over and the next round begins.
During break time the leftmost segment of the display will "turn around" symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. All changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
d56012da1871333124f36699a045cd80bf2c1218
4196
4195
2017-08-22T16:18:49Z
Daniel L
2607
/* Features */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge sitting consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal is sounded when the end of a round approaches, a different signal is sounded at the end of a round, and a third signal is sounded when the break time is over and the next round begins.
During break time the leftmost segment of the display will "turn around" symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. All changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
48a408a1b41f6b981b4818a22b2094ea6ed6c8e8
4197
4196
2017-08-22T16:19:37Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal is sounded when the end of a round approaches, a different signal is sounded at the end of a round, and a third signal is sounded when the break time is over and the next round begins.
During break time the leftmost segment of the display will "turn around" symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. All changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
33ab66bce788e65e3e02a7981f9d5ddd85fd4da5
4198
4197
2017-08-22T16:27:50Z
Rew
3
/* Using the Bridgetimer */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost segment of the display will "turn around" symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. All changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
ed9720c276cc4ce23b551924ea077a8fc6ef7a6f
4199
4198
2017-08-22T16:29:03Z
Rew
3
/* Using the Bridgetimer */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. All changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
35de48bc77b1b47b2ef6ea9d043af1b383d70ca9
4200
4199
2017-08-22T16:34:22Z
Rew
3
/* Creating custom programs */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the defaults of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 20 is a bit dim, about 30 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
3dda0f99ed610e138bbc4ddd7e637690c3652c96
4201
4200
2017-08-22T16:35:25Z
Rew
3
/* Creating custom programs */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
5f4ed818f2a1bf1ef4f7aa53a5f1298352700760
4202
4201
2017-08-22T16:36:12Z
Rew
3
/* Creating custom programs */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will flicker the display. Don't use those.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
af60a4e1539ae3fb0e1cc080c2307ffb9d97994c
4203
4202
2017-08-22T17:12:35Z
Rew
3
/* Creating custom programs */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When turned on the clock always starts back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will always start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other club" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
f92b5d73962bb08dc60e52d3f980dda1f80584c2
4204
4203
2017-08-22T17:14:23Z
Rew
3
/* Suggestions for use */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost may be used to mount the Bridgetimer, the outermost is used for restoring the default settings and the innermost is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
3c494606b918919e6573a266e2c53551e0c8a60f
Bridgeklok
0
1984
4154
2017-05-26T13:42:28Z
Rew
3
Created page with "= Bridgeklok = == Introductie == BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontwo..."
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontworpen en gebouwd. Wij zijn niet gespecialiseerd in bridge producten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen heeft. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Ongebruikte programmas beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd, en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
29d905d5f084022b960d9fe530ef4d134b068149
4155
4154
2017-05-26T13:54:11Z
Rew
3
/* Introductie */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontworpen en gebouwd. Wij zijn niet gespecialiseerd in bridge producten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Ongebruikte programmas beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd, en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
93a09cca78d33cc14a1017318df13a8a60bd77cf
4159
4155
2017-05-28T09:30:26Z
Rew
3
/* Normaal gebruik */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontworpen en gebouwd. Wij zijn niet gespecialiseerd in bridge producten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Ongebruikte programmas beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd, en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
2ef8271250a308e62a0aa771c1143779e997aae8
4160
4159
2017-05-28T09:33:39Z
Rew
3
/* De klok instellen. */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontworpen en gebouwd. Wij zijn niet gespecialiseerd in bridge producten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Ongebruikte programmas beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
a2794fa985e9ca5138b174f9ecbd2a3bbf0c1d26
4161
4160
2017-05-28T09:34:34Z
Rew
3
/* De klok instellen. */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontworpen en gebouwd. Wij zijn niet gespecialiseerd in bridge producten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
ec351309c70ba9f20c1389e2e810253a632752b8
4162
4161
2017-05-28T09:35:42Z
Rew
3
/* De klok instellen. */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontworpen en gebouwd. Wij zijn niet gespecialiseerd in bridge producten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
346d3f3d9af385a31b77476a1b481a4cfad10f69
4163
4162
2017-05-28T09:38:57Z
Rew
3
/* Gebruik suggesties */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen z'n club een nieuwe bridgeclock wilde hebben, hebben we er 1 ontworpen en gebouwd. Wij zijn niet gespecialiseerd in bridge producten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
1ca339aed0137ed508a1720175e7a477743218ad
4164
4163
2017-05-30T14:57:26Z
RHr
2599
/* Introductie */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat door een iets andere manier van een clubavond organiseren uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
2e371c4c680e825ab25d24f8a92fdf60d191a3c0
4165
4164
2017-05-30T14:58:33Z
RHr
2599
/* Introductie */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in de stroom steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
5f0c24249e1cd61edbceb423c45a39d35eaf4fe0
4166
4165
2017-05-30T14:59:42Z
RHr
2599
/* Normaal gebruik */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben dus gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in het stopcontact steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
e1cd90e4a323cf413d45aa9811db8b98109d909d
4167
4166
2017-05-30T15:00:19Z
RHr
2599
/* Introductie */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in het stopcontact steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P5 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
95fafb8be05cbed1052823c02a052346c1fcf4a3
4168
4167
2017-05-30T15:20:18Z
RHr
2599
/* De klok instellen. */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in het stopcontact steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P4 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie". Veranderingen worden automatisch opgeslagen.
Programmas die nog nooit aangepast zijn beginnen op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat).
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
8d5514d277624dd0ea94a580243e735b73a16b90
4169
4168
2017-05-31T13:25:01Z
Rew
3
/* De klok instellen. */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Pluspunten ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in het stopcontact steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
De klok heeft vier programmas die door de gebruiker ingesteld kunnen worden. Ieder programma bestaat uit een instelling voor speeltijd, waarschuwingstijd en wisseltijd. Een programma wat nog nooit aangepast is staat op 30-5-3.
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P4 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie" (P1-P4). Veranderingen worden automatisch opgeslagen.
Om het huidige progamma te starten, kunt u op '''pause''' drukken. Het programma start dan altijd bovenin de speeltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat). Indien u tevreden bent met de instelling kunt u de klok uitstellen
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
cd4f76ca66288c5c96010e1bb7b5e3fea6b1b785
4173
4169
2017-06-12T11:45:02Z
Rew
3
/* Pluspunten */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Kenmerken ==
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Groot display.
* Voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Directe aanpassing van de lopende ronde/wisseltijd.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in het stopcontact steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
De klok heeft vier programmas die door de gebruiker ingesteld kunnen worden. Ieder programma bestaat uit een instelling voor speeltijd, waarschuwingstijd en wisseltijd. Een programma wat nog nooit aangepast is staat op 30-5-3.
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P4 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie" (P1-P4). Veranderingen worden automatisch opgeslagen.
Om het huidige progamma te starten, kunt u op '''pause''' drukken. Het programma start dan altijd bovenin de speeltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat). Indien u tevreden bent met de instelling kunt u de klok uitstellen
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
48cc0e1b5dfa549e74044648aa5da19359af93e6
4174
4173
2017-06-12T11:46:47Z
Rew
3
/* Kenmerken */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Kenmerken ==
* Groot display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== Normaal gebruik ==
De bridgeklok is eenvoudig in gebruik. Gewoon in het stopcontact steken, aanzetten en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd ("ga zitten tijd"?) in te stellen met de '''up''' toets. U kunt ook de klok pauseren met de '''pause''' knop. Ook kunt u een ander programma selecteren door op '''mode''' te dukken en dan een ander programma te selecteren.
Mocht het om de een of andere reden nodig zijn om de huidige ronde of wisseltijd te verlengen is dat simpel te regelen door op '''up''' te drukken. Is iedereen al klaar, kunt u de tijd verkorten door op '''down''' te drukken.
Weet u nog niet hoelang er gepauseerd moet worden, kunt u de klok pauseren en hervatten met de '''pause''' knop.
Het waarschuwingssignaal klinkt 5 minuten voor het einde van de rond.
Een ander geluid klinkt bij het einde van de ronde.
Tijdens de wisseltijd is er een enkel segment in het eerste display wat "rondloopt". Dit symboliseert het rondlopen van de spelers. Zo is het verschil zichtbaar tussen "nog 2 minuten wisseltijd" en "nog 2 minuten te spelen".
Een derde signaal klinkt als de volgende ronde begint.
== De klok instellen. ==
De klok heeft vier programmas die door de gebruiker ingesteld kunnen worden. Ieder programma bestaat uit een instelling voor speeltijd, waarschuwingstijd en wisseltijd. Een programma wat nog nooit aangepast is staat op 30-5-3.
Om de klok in te stellen, drukt u op '''mode'''. De '''up''' en '''down''' knoppen selecteren nu het voorkeuze programma. Deze worden als P1 tot en met P4 weergegeven. Om het programma te starten drukt u op '''pause'''. U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' te drukken.
Voor ieder programma zijn er drie instellingen: speeltijd, waarschuwingstijd en wisseltijd. Ieder van deze wordt met de '''up''' en '''down''' knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld. De andere in stappen van 1 minuut.
Nogmaals op '''mode''' drukken gaat verder naar de volgende instelling. Na "wisseltijd" komt weer "programma selectie" (P1-P4). Veranderingen worden automatisch opgeslagen.
Om het huidige progamma te starten, kunt u op '''pause''' drukken. Het programma start dan altijd bovenin de speeltijd.
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt nu de knop '''pause''' ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display samen met de huidige instelling. (De "I" is anders dan de "1" doordat ie links in het display staat). Indien u tevreden bent met de instelling kunt u de klok uitstellen
U kunt nu de huidige instelling veranderen met '''up''' en '''down''' tussen de 0 en de 99 in stapjes van drie. Het display gaat knipperen op de allerlaagste standen. Die maar niet gebruiken. De standaardinstelling van 20 is ietwat donker. Een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Gebruik suggesties ==
De klok start altijd op P1. De reden hiervoor is dat als twee clubs met verschillende instellingen wekelijks spelen en de klok delen hij altijd verkeerd zou staan als ie de laatste stand zou onthouden. Door steeds op P1 te beginnen kan ie tenminste "soms" goed staan.
Indien u de klok niet deelt en vrijwel altijd hetzelfde programma gebruikt stelt u dat gewoon op P1 in. U kunt gewoon de klok starten en evt de eerste wisseltijd of -speeltijd iets aanpassen. Indien u een enkele keer een ander programma nodig heeft, doet u dat met P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Indien u de klok regelmatig deelt met een drive die andere instellingen nodig heeft, dan raad ik aan om de instellingen in P2 en P3 (en zo nodig hoger) te bewaren. Ervaring leert dat hulpvaardige handen vaak aan P1 gaan zitten rommelen. Die drive komt dan gewoon goed omdat het "ter plekke" goed is ingesteld, maar de hogere programmas blijven dan gelukkig bewaard.
== Suggesties en feedback ==
Zoals eerder vermeld, waarderen we het als u verzoeken doorgeeft. Geen garanties dat we dat onmiddelijk kunnen implementeren, maar we waarderen uw input.
Mogelijkheden waarvan we reeds weten dat die door sommigen gevraagd worden zijn:
* Meerdere klokken in een hoofdklok-hulpklok configuratie.
* afstandsbediening.
Enerzijds mocht u dat wensen, dan weten we dat al. Anderzijds, als u het toch doorgeeft, krijgen wij een indruk van hoe groot de markt voor zo'n feature is en kunnen we u laten weten wanneer zo'n suggestie beschikbaar is gekomen. Andere suggesties en feedback zijn natuurlijk ook welkom.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling. Ondertussen biedt het bijna dezelfde functionalteit als V1.
77e650c30d9c7271b764ac65ef8f3880eeae6ba9
4175
4174
2017-06-12T12:07:44Z
Rew
3
/* Bridgeklok */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
Een bridgezitting bestaat uit een aantal rondes met tussen de rondes een korte pauze om van tafel te wisselen. De bridgeklok telt de tijd af die zo'n ronde en de daarop volgende wissel periode duurt en geeft daarbij een aantal geluidssignalen:
* Beginsignaal van de ronde (einde van de wisseltijd)
* Waarschuwingssignaal nadering einde ronde
* Eindsignaal van de ronde, tevens begin van de wisseltijd
=== oud ===
BitWizard is een klein bedrijfje met aan het hoofd een bridgespeler. Toen de lokale club een nieuwe bridgeclock nodig had, hebben we een ontwerp gemaakt en gebouwd. Wij zijn gespecialiseerd in elektronica en hebben de middelen om snel een ontwerp te produceren. We hebben gebouwd wat we zelf nodig achten en wat we vermoeden dat anderen ook handig zullen vinden. Indien u vindt dat iets verbeterd kan worden, laat het ons gerust weten! Het is heel goed mogelijk dat, door een iets andere manier van een clubavond organiseren, uw club andere eisen aan de bridgeklok stelt. Het is mogelijk dat we uw klok van nieuwe software kunnen voorzien zonder de hardware te vervangen.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons weten. Waarschijnlijk is de hardware al geschikt, en kunnen we de software eenvoudig aanpassen voor de andere toepassing. Mocht u een idee hebben, laat het ons weten!
== Kenmerken ==
De BitWizard Bridgeklok heeft als kenmerken:
* Groot, goed leesbaar display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== Aan de slag ==
De bridgeklok is eenvoudig in gebruik. Gewoon de adapter in de klok en in het stopcontact steken, de klok aanzetten met de aan/uit schakelaar (1) en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd in te stellen (zie hieronder).
De klok start altijd op in programma P1. Standaard staan alle programma’s ingesteld op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
U kunt een ander programma selecteren door op mode (2) te drukken en vervolgens met behulp van up (3) en down (4) een ander programma te selecteren. Het programma kan vervolgens gestart worden met de pause (run) knop (5).
U kunt de klok pauzeren en vervolgens hervatten met de pause (5) knop.
Als het nodig is om de huidige ronde- of wisseltijd te verlengen (in stappen van 1 minuut) dan is dat simpel te regelen door op '''up''' (3) te drukken. Ook is het mogelijk om de ronde- of wisseltijd in stappen van 1 minuut te verkorten door op '''down''' (4) te drukken.
Bij het naderen van het einde van de ronde klinkt er een waarschuwingssignaal.
Een ander geluid klinkt bij het einde van de ronde.
Een derde signaal klinkt als de wisseltijd voorbij is en de volgende ronde begint.
Gedurende de wisseltijd is er links in het display een enkel segment dat "rondloopt" en het rondlopen van de spelers symboliseert. Zo is het verschil te zien tussen wisseltijd en speeltijd.
== Programma instellen ==
Om de keuzeprogramma’s in te stellen, drukt u eerst op '''mode''' (2).
Met de '''up''' (3) en '''down''' (4) knoppen kunt u vervolgens het keuzeprogramma selecteren. Deze worden als P1 tot en met P4 weergegeven.
Om het gekozen programma te starten drukt u op '''pause''' (5).
U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' (2) te drukken.
Voor ieder programma kunnen achtereenvolgens drie tijden ingesteld worden: de speeltijd, de waarschuwingstijd en de wisseltijd. Standaard is 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
De tijden worden met de '''up''' (3) en '''down''' (4) knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld, de speeltijd en waarschuwingstijd in stappen van 1 minuut.
Door nogmaals op '''mode''' (2) drukken gaat u verder naar de instelling van de volgende tijd. Na "wisseltijd" komt u weer in "programma selectie". Om het programma te starten drukt u op '''pause''' (5).
Veranderingen worden automatisch opgeslagen.
De bridgeklok start altijd op met programma P1 omdat als twee clubs die om en om spelen de klok zouden delen met verschillende instellingen, hij dan altijd verkeerd zou staan als hij de laatste stand zou onthouden. Door steeds op P1 te beginnen is er een kans dat hij in sommige gevallen goed staat.
Als u de enige gebruiker van de klok bent en vrijwel altijd hetzelfde programma gebruikt, dan kunt u dat op P1 instellen. U kunt dan gewoon de klok starten en eventueel de eerste wisseltijd of -speeltijd iets aanpassen.
Als u een enkele keer een ander programma nodig heeft, dan doet u dat op P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Als u de klok regelmatig gebruikt voor een drive die andere instellingen nodig heeft, dan raad ik aan om uw normale instellingen in P2 en P3 (en zo nodig hoger) op te slaan. Ervaring leert dat hulpvaardige handen tijdens de drive vaak aan P1 gaan zitten rommelen, maar de hogere programma’s blijven dan gelukkig bewaard.
== Helderheid instellen ==
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt vervolgens de '''pause''' knop (5) ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display, samen met de huidige instelling (I van het engelse '''I'''ntensity, of '''I'''nstellen helderheid).
De standaard helderheid is 20. Met behulp van de '''up''' (3) en '''down''' (4) knoppen kunt u de huidige waarde veranderen tussen de 0 en de 99 in stapjes van drie. Om de bridgeklok te starten, drukt u op '''mode''' (2) of '''pause''' (5).
'''Let op''': op de allerlaagste standen gaat het display knipperen, dus die kunt u beter niet gebruiken! De standaardinstelling van 20 is ietwat donker, een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== feedback ==
BitWizard is een klein elektronicabedrijfje met aan het hoofd een bridgespeler. Toen zijn bridgeclub een nieuwe bridgeklok wilde hebben, hebben we er eentje ontworpen en gebouwd.
Wij zijn niet gespecialiseerd in bridgeproducten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we denken dat anderen ook handig zullen vinden, maar mogelijk dat uw club andere eisen aan een bridgeklok stelt. Mocht u ideeën hebben voor verbetering van onze bridgeklok, laat het ons dan alstublieft weten! Wellicht kunnen we de software van uw klok aanpassen om aan uw wensen te voldoen zonder de hardware te vervangen.
We kunnen helaas niet garanderen dat we uw suggesties kunnen implementeren, maar we laten het u weten wanneer uw wens beschikbaar komt.
Enkele suggesties die al binnen gekomen zijn:
* meerdere klokken in een hoofdklok-hulpklok configuratie
* afstandsbediening.
Mocht u hier ook interesse voor hebben, geef dat dan aan ons door zodat wij een indruk krijgen van hoe groot de markt voor deze features is.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons dan ook weten. Waarschijnlijk is de hardware al geschikt en kunnen we de software eenvoudig aanpassen voor de andere toepassing.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling.
621a334e7eb0c27dacba4919b1c8f1cb11c57583
4176
4175
2017-06-12T12:07:59Z
Rew
3
/* oud */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
Een bridgezitting bestaat uit een aantal rondes met tussen de rondes een korte pauze om van tafel te wisselen. De bridgeklok telt de tijd af die zo'n ronde en de daarop volgende wissel periode duurt en geeft daarbij een aantal geluidssignalen:
* Beginsignaal van de ronde (einde van de wisseltijd)
* Waarschuwingssignaal nadering einde ronde
* Eindsignaal van de ronde, tevens begin van de wisseltijd
== Kenmerken ==
De BitWizard Bridgeklok heeft als kenmerken:
* Groot, goed leesbaar display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== Aan de slag ==
De bridgeklok is eenvoudig in gebruik. Gewoon de adapter in de klok en in het stopcontact steken, de klok aanzetten met de aan/uit schakelaar (1) en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd in te stellen (zie hieronder).
De klok start altijd op in programma P1. Standaard staan alle programma’s ingesteld op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
U kunt een ander programma selecteren door op mode (2) te drukken en vervolgens met behulp van up (3) en down (4) een ander programma te selecteren. Het programma kan vervolgens gestart worden met de pause (run) knop (5).
U kunt de klok pauzeren en vervolgens hervatten met de pause (5) knop.
Als het nodig is om de huidige ronde- of wisseltijd te verlengen (in stappen van 1 minuut) dan is dat simpel te regelen door op '''up''' (3) te drukken. Ook is het mogelijk om de ronde- of wisseltijd in stappen van 1 minuut te verkorten door op '''down''' (4) te drukken.
Bij het naderen van het einde van de ronde klinkt er een waarschuwingssignaal.
Een ander geluid klinkt bij het einde van de ronde.
Een derde signaal klinkt als de wisseltijd voorbij is en de volgende ronde begint.
Gedurende de wisseltijd is er links in het display een enkel segment dat "rondloopt" en het rondlopen van de spelers symboliseert. Zo is het verschil te zien tussen wisseltijd en speeltijd.
== Programma instellen ==
Om de keuzeprogramma’s in te stellen, drukt u eerst op '''mode''' (2).
Met de '''up''' (3) en '''down''' (4) knoppen kunt u vervolgens het keuzeprogramma selecteren. Deze worden als P1 tot en met P4 weergegeven.
Om het gekozen programma te starten drukt u op '''pause''' (5).
U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' (2) te drukken.
Voor ieder programma kunnen achtereenvolgens drie tijden ingesteld worden: de speeltijd, de waarschuwingstijd en de wisseltijd. Standaard is 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
De tijden worden met de '''up''' (3) en '''down''' (4) knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld, de speeltijd en waarschuwingstijd in stappen van 1 minuut.
Door nogmaals op '''mode''' (2) drukken gaat u verder naar de instelling van de volgende tijd. Na "wisseltijd" komt u weer in "programma selectie". Om het programma te starten drukt u op '''pause''' (5).
Veranderingen worden automatisch opgeslagen.
De bridgeklok start altijd op met programma P1 omdat als twee clubs die om en om spelen de klok zouden delen met verschillende instellingen, hij dan altijd verkeerd zou staan als hij de laatste stand zou onthouden. Door steeds op P1 te beginnen is er een kans dat hij in sommige gevallen goed staat.
Als u de enige gebruiker van de klok bent en vrijwel altijd hetzelfde programma gebruikt, dan kunt u dat op P1 instellen. U kunt dan gewoon de klok starten en eventueel de eerste wisseltijd of -speeltijd iets aanpassen.
Als u een enkele keer een ander programma nodig heeft, dan doet u dat op P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Als u de klok regelmatig gebruikt voor een drive die andere instellingen nodig heeft, dan raad ik aan om uw normale instellingen in P2 en P3 (en zo nodig hoger) op te slaan. Ervaring leert dat hulpvaardige handen tijdens de drive vaak aan P1 gaan zitten rommelen, maar de hogere programma’s blijven dan gelukkig bewaard.
== Helderheid instellen ==
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt vervolgens de '''pause''' knop (5) ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display, samen met de huidige instelling (I van het engelse '''I'''ntensity, of '''I'''nstellen helderheid).
De standaard helderheid is 20. Met behulp van de '''up''' (3) en '''down''' (4) knoppen kunt u de huidige waarde veranderen tussen de 0 en de 99 in stapjes van drie. Om de bridgeklok te starten, drukt u op '''mode''' (2) of '''pause''' (5).
'''Let op''': op de allerlaagste standen gaat het display knipperen, dus die kunt u beter niet gebruiken! De standaardinstelling van 20 is ietwat donker, een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== feedback ==
BitWizard is een klein elektronicabedrijfje met aan het hoofd een bridgespeler. Toen zijn bridgeclub een nieuwe bridgeklok wilde hebben, hebben we er eentje ontworpen en gebouwd.
Wij zijn niet gespecialiseerd in bridgeproducten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we denken dat anderen ook handig zullen vinden, maar mogelijk dat uw club andere eisen aan een bridgeklok stelt. Mocht u ideeën hebben voor verbetering van onze bridgeklok, laat het ons dan alstublieft weten! Wellicht kunnen we de software van uw klok aanpassen om aan uw wensen te voldoen zonder de hardware te vervangen.
We kunnen helaas niet garanderen dat we uw suggesties kunnen implementeren, maar we laten het u weten wanneer uw wens beschikbaar komt.
Enkele suggesties die al binnen gekomen zijn:
* meerdere klokken in een hoofdklok-hulpklok configuratie
* afstandsbediening.
Mocht u hier ook interesse voor hebben, geef dat dan aan ons door zodat wij een indruk krijgen van hoe groot de markt voor deze features is.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons dan ook weten. Waarschijnlijk is de hardware al geschikt en kunnen we de software eenvoudig aanpassen voor de andere toepassing.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling.
f00418589530b1ce562ab5a668cd9b55ff3e0d51
4177
4176
2017-06-12T12:20:15Z
Rew
3
/* feedback */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
Een bridgezitting bestaat uit een aantal rondes met tussen de rondes een korte pauze om van tafel te wisselen. De bridgeklok telt de tijd af die zo'n ronde en de daarop volgende wissel periode duurt en geeft daarbij een aantal geluidssignalen:
* Beginsignaal van de ronde (einde van de wisseltijd)
* Waarschuwingssignaal nadering einde ronde
* Eindsignaal van de ronde, tevens begin van de wisseltijd
== Kenmerken ==
De BitWizard Bridgeklok heeft als kenmerken:
* Groot, goed leesbaar display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== Aan de slag ==
De bridgeklok is eenvoudig in gebruik. Gewoon de adapter in de klok en in het stopcontact steken, de klok aanzetten met de aan/uit schakelaar (1) en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om een langere resterende wisseltijd in te stellen (zie hieronder).
De klok start altijd op in programma P1. Standaard staan alle programma’s ingesteld op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
U kunt een ander programma selecteren door op mode (2) te drukken en vervolgens met behulp van up (3) en down (4) een ander programma te selecteren. Het programma kan vervolgens gestart worden met de pause (run) knop (5).
U kunt de klok pauzeren en vervolgens hervatten met de pause (5) knop.
Als het nodig is om de huidige ronde- of wisseltijd te verlengen (in stappen van 1 minuut) dan is dat simpel te regelen door op '''up''' (3) te drukken. Ook is het mogelijk om de ronde- of wisseltijd in stappen van 1 minuut te verkorten door op '''down''' (4) te drukken.
Bij het naderen van het einde van de ronde klinkt er een waarschuwingssignaal.
Een ander geluid klinkt bij het einde van de ronde.
Een derde signaal klinkt als de wisseltijd voorbij is en de volgende ronde begint.
Gedurende de wisseltijd is er links in het display een enkel segment dat "rondloopt" en het rondlopen van de spelers symboliseert. Zo is het verschil te zien tussen wisseltijd en speeltijd.
== Programma instellen ==
Om de keuzeprogramma’s in te stellen, drukt u eerst op '''mode''' (2).
Met de '''up''' (3) en '''down''' (4) knoppen kunt u vervolgens het keuzeprogramma selecteren. Deze worden als P1 tot en met P4 weergegeven.
Om het gekozen programma te starten drukt u op '''pause''' (5).
U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' (2) te drukken.
Voor ieder programma kunnen achtereenvolgens drie tijden ingesteld worden: de speeltijd, de waarschuwingstijd en de wisseltijd. Standaard is 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
De tijden worden met de '''up''' (3) en '''down''' (4) knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld, de speeltijd en waarschuwingstijd in stappen van 1 minuut.
Door nogmaals op '''mode''' (2) drukken gaat u verder naar de instelling van de volgende tijd. Na "wisseltijd" komt u weer in "programma selectie". Om het programma te starten drukt u op '''pause''' (5).
Veranderingen worden automatisch opgeslagen.
De bridgeklok start altijd op met programma P1 omdat als twee clubs die om en om spelen de klok zouden delen met verschillende instellingen, hij dan altijd verkeerd zou staan als hij de laatste stand zou onthouden. Door steeds op P1 te beginnen is er een kans dat hij in sommige gevallen goed staat.
Als u de enige gebruiker van de klok bent en vrijwel altijd hetzelfde programma gebruikt, dan kunt u dat op P1 instellen. U kunt dan gewoon de klok starten en eventueel de eerste wisseltijd of -speeltijd iets aanpassen.
Als u een enkele keer een ander programma nodig heeft, dan doet u dat op P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Als u de klok regelmatig gebruikt voor een drive die andere instellingen nodig heeft, dan raad ik aan om uw normale instellingen in P2 en P3 (en zo nodig hoger) op te slaan. Ervaring leert dat hulpvaardige handen tijdens de drive vaak aan P1 gaan zitten rommelen, maar de hogere programma’s blijven dan gelukkig bewaard.
== Helderheid instellen ==
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt vervolgens de '''pause''' knop (5) ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display, samen met de huidige instelling (I van het engelse '''I'''ntensity, of '''I'''nstellen helderheid).
De standaard helderheid is 20. Met behulp van de '''up''' (3) en '''down''' (4) knoppen kunt u de huidige waarde veranderen tussen de 0 en de 99 in stapjes van drie. Om de bridgeklok te starten, drukt u op '''mode''' (2) of '''pause''' (5).
'''Let op''': op de allerlaagste standen gaat het display knipperen, dus die kunt u beter niet gebruiken! De standaardinstelling van 20 is ietwat donker, een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Feedback ==
BitWizard is een klein elektronicabedrijfje met aan het hoofd een bridgespeler. Toen zijn bridgeclub een nieuwe bridgeklok wilde hebben, hebben we er eentje ontworpen en gebouwd.
Wij zijn niet gespecialiseerd in bridgeproducten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we denken dat anderen ook handig zullen vinden, maar mogelijk dat uw club andere eisen aan een bridgeklok stelt. Mocht u ideeën hebben voor verbetering van onze bridgeklok, laat het ons dan alstublieft weten! Wellicht kunnen we de software van uw klok aanpassen om aan uw wensen te voldoen zonder de hardware te vervangen.
We kunnen helaas niet garanderen dat we uw suggesties kunnen implementeren, maar we laten het u weten wanneer uw wens beschikbaar komt.
Enkele suggesties die al binnen gekomen zijn:
* meerdere klokken in een hoofdklok-hulpklok configuratie
* afstandsbediening.
Mocht u hier ook interesse voor hebben, geef dat dan aan ons door zodat wij een indruk krijgen van hoe groot de markt voor deze features is.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons dan ook weten. Waarschijnlijk is de hardware al geschikt en kunnen we de software eenvoudig aanpassen voor de andere toepassing.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling.
9671a7d62e61b0ee58757bf9c1d7112b60522742
4178
4177
2017-06-12T12:38:01Z
Rew
3
/* Aan de slag */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
Een bridgezitting bestaat uit een aantal rondes met tussen de rondes een korte pauze om van tafel te wisselen. De bridgeklok telt de tijd af die zo'n ronde en de daarop volgende wissel periode duurt en geeft daarbij een aantal geluidssignalen:
* Beginsignaal van de ronde (einde van de wisseltijd)
* Waarschuwingssignaal nadering einde ronde
* Eindsignaal van de ronde, tevens begin van de wisseltijd
== Kenmerken ==
De BitWizard Bridgeklok heeft als kenmerken:
* Groot, goed leesbaar display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== Aan de slag ==
De bridgeklok is eenvoudig in gebruik. Gewoon de adapter in de klok en in het stopcontact steken, de klok aanzetten met de aan/uit schakelaar (1) en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om eventueel een langere resterende wisseltijd in te stellen (zie hieronder).
De klok start altijd op in programma P1. Standaard staan alle programma’s ingesteld op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
U kunt een ander programma selecteren door op mode (2) te drukken en vervolgens met behulp van up (3) en down (4) een ander programma te selecteren. Het programma kan vervolgens gestart worden met de pause (run) knop (5).
U kunt de klok pauzeren en vervolgens hervatten met de pause (5) knop.
Als het nodig is om de huidige ronde- of wisseltijd te verlengen (in stappen van 1 minuut) dan is dat simpel te regelen door op '''up''' (3) te drukken. Ook is het mogelijk om de ronde- of wisseltijd in stappen van 1 minuut te verkorten door op '''down''' (4) te drukken.
Bij het naderen van het einde van de ronde klinkt er een waarschuwingssignaal.
Een ander geluid klinkt bij het einde van de ronde.
Een derde signaal klinkt als de wisseltijd voorbij is en de volgende ronde begint.
Gedurende de wisseltijd is er links in het display een enkel segment dat "rondloopt" en het rondlopen van de spelers symboliseert. Zo is het verschil te zien tussen wisseltijd en speeltijd.
== Programma instellen ==
Om de keuzeprogramma’s in te stellen, drukt u eerst op '''mode''' (2).
Met de '''up''' (3) en '''down''' (4) knoppen kunt u vervolgens het keuzeprogramma selecteren. Deze worden als P1 tot en met P4 weergegeven.
Om het gekozen programma te starten drukt u op '''pause''' (5).
U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' (2) te drukken.
Voor ieder programma kunnen achtereenvolgens drie tijden ingesteld worden: de speeltijd, de waarschuwingstijd en de wisseltijd. Standaard is 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
De tijden worden met de '''up''' (3) en '''down''' (4) knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld, de speeltijd en waarschuwingstijd in stappen van 1 minuut.
Door nogmaals op '''mode''' (2) drukken gaat u verder naar de instelling van de volgende tijd. Na "wisseltijd" komt u weer in "programma selectie". Om het programma te starten drukt u op '''pause''' (5).
Veranderingen worden automatisch opgeslagen.
De bridgeklok start altijd op met programma P1 omdat als twee clubs die om en om spelen de klok zouden delen met verschillende instellingen, hij dan altijd verkeerd zou staan als hij de laatste stand zou onthouden. Door steeds op P1 te beginnen is er een kans dat hij in sommige gevallen goed staat.
Als u de enige gebruiker van de klok bent en vrijwel altijd hetzelfde programma gebruikt, dan kunt u dat op P1 instellen. U kunt dan gewoon de klok starten en eventueel de eerste wisseltijd of -speeltijd iets aanpassen.
Als u een enkele keer een ander programma nodig heeft, dan doet u dat op P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Als u de klok regelmatig gebruikt voor een drive die andere instellingen nodig heeft, dan raad ik aan om uw normale instellingen in P2 en P3 (en zo nodig hoger) op te slaan. Ervaring leert dat hulpvaardige handen tijdens de drive vaak aan P1 gaan zitten rommelen, maar de hogere programma’s blijven dan gelukkig bewaard.
== Helderheid instellen ==
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt vervolgens de '''pause''' knop (5) ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display, samen met de huidige instelling (I van het engelse '''I'''ntensity, of '''I'''nstellen helderheid).
De standaard helderheid is 20. Met behulp van de '''up''' (3) en '''down''' (4) knoppen kunt u de huidige waarde veranderen tussen de 0 en de 99 in stapjes van drie. Om de bridgeklok te starten, drukt u op '''mode''' (2) of '''pause''' (5).
'''Let op''': op de allerlaagste standen gaat het display knipperen, dus die kunt u beter niet gebruiken! De standaardinstelling van 20 is ietwat donker, een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Feedback ==
BitWizard is een klein elektronicabedrijfje met aan het hoofd een bridgespeler. Toen zijn bridgeclub een nieuwe bridgeklok wilde hebben, hebben we er eentje ontworpen en gebouwd.
Wij zijn niet gespecialiseerd in bridgeproducten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we denken dat anderen ook handig zullen vinden, maar mogelijk dat uw club andere eisen aan een bridgeklok stelt. Mocht u ideeën hebben voor verbetering van onze bridgeklok, laat het ons dan alstublieft weten! Wellicht kunnen we de software van uw klok aanpassen om aan uw wensen te voldoen zonder de hardware te vervangen.
We kunnen helaas niet garanderen dat we uw suggesties kunnen implementeren, maar we laten het u weten wanneer uw wens beschikbaar komt.
Enkele suggesties die al binnen gekomen zijn:
* meerdere klokken in een hoofdklok-hulpklok configuratie
* afstandsbediening.
Mocht u hier ook interesse voor hebben, geef dat dan aan ons door zodat wij een indruk krijgen van hoe groot de markt voor deze features is.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons dan ook weten. Waarschijnlijk is de hardware al geschikt en kunnen we de software eenvoudig aanpassen voor de andere toepassing.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling.
061c55e29127e1d3c22be39ac35bf525eaee566b
4180
4178
2017-06-12T12:46:09Z
Rew
3
/* Kenmerken */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
Een bridgezitting bestaat uit een aantal rondes met tussen de rondes een korte pauze om van tafel te wisselen. De bridgeklok telt de tijd af die zo'n ronde en de daarop volgende wissel periode duurt en geeft daarbij een aantal geluidssignalen:
* Beginsignaal van de ronde (einde van de wisseltijd)
* Waarschuwingssignaal nadering einde ronde
* Eindsignaal van de ronde, tevens begin van de wisseltijd
== Kenmerken ==
De BitWizard Bridgeklok heeft als kenmerken:
* Groot, goed leesbaar display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== bedieningselementen ==
[[File:Bridgeklok_edit.png|600px]]
Omdat de ruimte voor de naampjes van de knoppen beperkt is, is gekozen voor korte namen. Vooral de '''pause''' (5) knop dekt niet geheel de lading. Het is eigenlijk '''start/stop'''.
== Aan de slag ==
De bridgeklok is eenvoudig in gebruik. Gewoon de adapter in de klok en in het stopcontact steken, de klok aanzetten met de aan/uit schakelaar (1) en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om eventueel een langere resterende wisseltijd in te stellen (zie hieronder).
De klok start altijd op in programma P1. Standaard staan alle programma’s ingesteld op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
U kunt een ander programma selecteren door op mode (2) te drukken en vervolgens met behulp van up (3) en down (4) een ander programma te selecteren. Het programma kan vervolgens gestart worden met de pause (run) knop (5).
U kunt de klok pauzeren en vervolgens hervatten met de pause (5) knop.
Als het nodig is om de huidige ronde- of wisseltijd te verlengen (in stappen van 1 minuut) dan is dat simpel te regelen door op '''up''' (3) te drukken. Ook is het mogelijk om de ronde- of wisseltijd in stappen van 1 minuut te verkorten door op '''down''' (4) te drukken.
Bij het naderen van het einde van de ronde klinkt er een waarschuwingssignaal.
Een ander geluid klinkt bij het einde van de ronde.
Een derde signaal klinkt als de wisseltijd voorbij is en de volgende ronde begint.
Gedurende de wisseltijd is er links in het display een enkel segment dat "rondloopt" en het rondlopen van de spelers symboliseert. Zo is het verschil te zien tussen wisseltijd en speeltijd.
== Programma instellen ==
Om de keuzeprogramma’s in te stellen, drukt u eerst op '''mode''' (2).
Met de '''up''' (3) en '''down''' (4) knoppen kunt u vervolgens het keuzeprogramma selecteren. Deze worden als P1 tot en met P4 weergegeven.
Om het gekozen programma te starten drukt u op '''pause''' (5).
U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' (2) te drukken.
Voor ieder programma kunnen achtereenvolgens drie tijden ingesteld worden: de speeltijd, de waarschuwingstijd en de wisseltijd. Standaard is 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
De tijden worden met de '''up''' (3) en '''down''' (4) knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld, de speeltijd en waarschuwingstijd in stappen van 1 minuut.
Door nogmaals op '''mode''' (2) drukken gaat u verder naar de instelling van de volgende tijd. Na "wisseltijd" komt u weer in "programma selectie". Om het programma te starten drukt u op '''pause''' (5).
Veranderingen worden automatisch opgeslagen.
De bridgeklok start altijd op met programma P1 omdat als twee clubs die om en om spelen de klok zouden delen met verschillende instellingen, hij dan altijd verkeerd zou staan als hij de laatste stand zou onthouden. Door steeds op P1 te beginnen is er een kans dat hij in sommige gevallen goed staat.
Als u de enige gebruiker van de klok bent en vrijwel altijd hetzelfde programma gebruikt, dan kunt u dat op P1 instellen. U kunt dan gewoon de klok starten en eventueel de eerste wisseltijd of -speeltijd iets aanpassen.
Als u een enkele keer een ander programma nodig heeft, dan doet u dat op P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Als u de klok regelmatig gebruikt voor een drive die andere instellingen nodig heeft, dan raad ik aan om uw normale instellingen in P2 en P3 (en zo nodig hoger) op te slaan. Ervaring leert dat hulpvaardige handen tijdens de drive vaak aan P1 gaan zitten rommelen, maar de hogere programma’s blijven dan gelukkig bewaard.
== Helderheid instellen ==
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt vervolgens de '''pause''' knop (5) ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display, samen met de huidige instelling (I van het engelse '''I'''ntensity, of '''I'''nstellen helderheid).
De standaard helderheid is 20. Met behulp van de '''up''' (3) en '''down''' (4) knoppen kunt u de huidige waarde veranderen tussen de 0 en de 99 in stapjes van drie. Om de bridgeklok te starten, drukt u op '''mode''' (2) of '''pause''' (5).
'''Let op''': op de allerlaagste standen gaat het display knipperen, dus die kunt u beter niet gebruiken! De standaardinstelling van 20 is ietwat donker, een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Feedback ==
BitWizard is een klein elektronicabedrijfje met aan het hoofd een bridgespeler. Toen zijn bridgeclub een nieuwe bridgeklok wilde hebben, hebben we er eentje ontworpen en gebouwd.
Wij zijn niet gespecialiseerd in bridgeproducten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we denken dat anderen ook handig zullen vinden, maar mogelijk dat uw club andere eisen aan een bridgeklok stelt. Mocht u ideeën hebben voor verbetering van onze bridgeklok, laat het ons dan alstublieft weten! Wellicht kunnen we de software van uw klok aanpassen om aan uw wensen te voldoen zonder de hardware te vervangen.
We kunnen helaas niet garanderen dat we uw suggesties kunnen implementeren, maar we laten het u weten wanneer uw wens beschikbaar komt.
Enkele suggesties die al binnen gekomen zijn:
* meerdere klokken in een hoofdklok-hulpklok configuratie
* afstandsbediening.
Mocht u hier ook interesse voor hebben, geef dat dan aan ons door zodat wij een indruk krijgen van hoe groot de markt voor deze features is.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons dan ook weten. Waarschijnlijk is de hardware al geschikt en kunnen we de software eenvoudig aanpassen voor de andere toepassing.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling.
21fd27da1124be096627ee6c3f66f1aeea2ecde9
4181
4180
2017-06-12T12:47:32Z
Rew
3
/* bedieningselementen */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
Een bridgezitting bestaat uit een aantal rondes met tussen de rondes een korte pauze om van tafel te wisselen. De bridgeklok telt de tijd af die zo'n ronde en de daarop volgende wissel periode duurt en geeft daarbij een aantal geluidssignalen:
* Beginsignaal van de ronde (einde van de wisseltijd)
* Waarschuwingssignaal nadering einde ronde
* Eindsignaal van de ronde, tevens begin van de wisseltijd
== Kenmerken ==
De BitWizard Bridgeklok heeft als kenmerken:
* Groot, goed leesbaar display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== Bedieningselementen ==
[[File:Bridgeklok_edit.png|600px]]
Omdat de ruimte voor de naampjes van de knoppen beperkt is, is gekozen voor korte namen. Vooral de '''pause''' (5) knop dekt niet geheel de lading. Het is eigenlijk '''start/stop'''.
== Aan de slag ==
De bridgeklok is eenvoudig in gebruik. Gewoon de adapter in de klok en in het stopcontact steken, de klok aanzetten met de aan/uit schakelaar (1) en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om eventueel een langere resterende wisseltijd in te stellen (zie hieronder).
De klok start altijd op in programma P1. Standaard staan alle programma’s ingesteld op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
U kunt een ander programma selecteren door op mode (2) te drukken en vervolgens met behulp van up (3) en down (4) een ander programma te selecteren. Het programma kan vervolgens gestart worden met de pause (run) knop (5).
U kunt de klok pauzeren en vervolgens hervatten met de pause (5) knop.
Als het nodig is om de huidige ronde- of wisseltijd te verlengen (in stappen van 1 minuut) dan is dat simpel te regelen door op '''up''' (3) te drukken. Ook is het mogelijk om de ronde- of wisseltijd in stappen van 1 minuut te verkorten door op '''down''' (4) te drukken.
Bij het naderen van het einde van de ronde klinkt er een waarschuwingssignaal.
Een ander geluid klinkt bij het einde van de ronde.
Een derde signaal klinkt als de wisseltijd voorbij is en de volgende ronde begint.
Gedurende de wisseltijd is er links in het display een enkel segment dat "rondloopt" en het rondlopen van de spelers symboliseert. Zo is het verschil te zien tussen wisseltijd en speeltijd.
== Programma instellen ==
Om de keuzeprogramma’s in te stellen, drukt u eerst op '''mode''' (2).
Met de '''up''' (3) en '''down''' (4) knoppen kunt u vervolgens het keuzeprogramma selecteren. Deze worden als P1 tot en met P4 weergegeven.
Om het gekozen programma te starten drukt u op '''pause''' (5).
U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' (2) te drukken.
Voor ieder programma kunnen achtereenvolgens drie tijden ingesteld worden: de speeltijd, de waarschuwingstijd en de wisseltijd. Standaard is 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
De tijden worden met de '''up''' (3) en '''down''' (4) knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld, de speeltijd en waarschuwingstijd in stappen van 1 minuut.
Door nogmaals op '''mode''' (2) drukken gaat u verder naar de instelling van de volgende tijd. Na "wisseltijd" komt u weer in "programma selectie". Om het programma te starten drukt u op '''pause''' (5).
Veranderingen worden automatisch opgeslagen.
De bridgeklok start altijd op met programma P1 omdat als twee clubs die om en om spelen de klok zouden delen met verschillende instellingen, hij dan altijd verkeerd zou staan als hij de laatste stand zou onthouden. Door steeds op P1 te beginnen is er een kans dat hij in sommige gevallen goed staat.
Als u de enige gebruiker van de klok bent en vrijwel altijd hetzelfde programma gebruikt, dan kunt u dat op P1 instellen. U kunt dan gewoon de klok starten en eventueel de eerste wisseltijd of -speeltijd iets aanpassen.
Als u een enkele keer een ander programma nodig heeft, dan doet u dat op P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Als u de klok regelmatig gebruikt voor een drive die andere instellingen nodig heeft, dan raad ik aan om uw normale instellingen in P2 en P3 (en zo nodig hoger) op te slaan. Ervaring leert dat hulpvaardige handen tijdens de drive vaak aan P1 gaan zitten rommelen, maar de hogere programma’s blijven dan gelukkig bewaard.
== Helderheid instellen ==
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt vervolgens de '''pause''' knop (5) ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display, samen met de huidige instelling (I van het engelse '''I'''ntensity, of '''I'''nstellen helderheid).
De standaard helderheid is 20. Met behulp van de '''up''' (3) en '''down''' (4) knoppen kunt u de huidige waarde veranderen tussen de 0 en de 99 in stapjes van drie. Om de bridgeklok te starten, drukt u op '''mode''' (2) of '''pause''' (5).
'''Let op''': op de allerlaagste standen gaat het display knipperen, dus die kunt u beter niet gebruiken! De standaardinstelling van 20 is ietwat donker, een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Feedback ==
BitWizard is een klein elektronicabedrijfje met aan het hoofd een bridgespeler. Toen zijn bridgeclub een nieuwe bridgeklok wilde hebben, hebben we er eentje ontworpen en gebouwd.
Wij zijn niet gespecialiseerd in bridgeproducten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we denken dat anderen ook handig zullen vinden, maar mogelijk dat uw club andere eisen aan een bridgeklok stelt. Mocht u ideeën hebben voor verbetering van onze bridgeklok, laat het ons dan alstublieft weten! Wellicht kunnen we de software van uw klok aanpassen om aan uw wensen te voldoen zonder de hardware te vervangen.
We kunnen helaas niet garanderen dat we uw suggesties kunnen implementeren, maar we laten het u weten wanneer uw wens beschikbaar komt.
Enkele suggesties die al binnen gekomen zijn:
* meerdere klokken in een hoofdklok-hulpklok configuratie
* afstandsbediening.
Mocht u hier ook interesse voor hebben, geef dat dan aan ons door zodat wij een indruk krijgen van hoe groot de markt voor deze features is.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons dan ook weten. Waarschijnlijk is de hardware al geschikt en kunnen we de software eenvoudig aanpassen voor de andere toepassing.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 zal een STM32F072 processor bevatten en dezelfde led driver. Op het ogenblik (mei 2017) is V2 nog in ontwikkeling.
0b4689237b854c17e3b630f491f17577662a5a2d
Dmx interface for raspberry pi
0
1968
4170
4119
2017-05-31T13:59:42Z
Rew
3
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
b98c373044fda30193b64734e81b80e790e4307a
Main Page
0
1
4171
4108
2017-06-08T13:18:52Z
Buttonius
2600
Added User Interface to Raspberry Pi projects
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= DMX =
* [[Dmx interface for raspberry pi]]
* [[Assembling the DMX case]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS reciever connected to Raspberry Pi]]
* [[User Interface]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function in bar at the top (on the right).
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
7548422c4e53d2d1dbdbb67e869d86fe277a1fd6
4172
4171
2017-06-08T13:21:05Z
Buttonius
2600
/* Raspberry Pi projects */ Typo in link to not yet existing page
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= DMX =
* [[Dmx interface for raspberry pi]]
* [[Assembling the DMX case]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS receiver connected to Raspberry Pi]]
* [[User Interface]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function in bar at the top (on the right).
* [http://www.bitwizard.nl/contact.php Contact us]
* Or use the [http://forum.bitwizard.nl/ forum]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
6fcd4215094f8de37d113f2c112193e577a8d7d7
4192
4172
2017-07-07T06:42:46Z
Rew
3
/* Help! */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= DMX =
* [[Dmx interface for raspberry pi]]
* [[Assembling the DMX case]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS receiver connected to Raspberry Pi]]
* [[User Interface]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function in bar at the top (on the right).
* [http://www.bitwizard.nl/contact.php Contact us]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
73b032440b4868f3ca4d4fa9a02a00c8c9f93a58
File:Bridgeklok edit.png
6
1985
4179
2017-06-12T12:41:03Z
Rew
3
Bridgeklok
wikitext
text/x-wiki
Bridgeklok
ed8f8cad4823afedba7b8bce1cf5f2c1c6610885
Besc
0
1986
4182
2017-06-24T14:18:31Z
Rew
3
Created page with "== BESC -- BitWizard ESC == === introduction === The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that..."
wikitext
text/x-wiki
== BESC -- BitWizard ESC ==
=== introduction ===
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
=== getting started ===
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly (or not (*)) immediately.
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
(*) it blows up trust me, just maybe not spectacularly.
85252738825a29e2b6b547cac645329c27471618
4183
4182
2017-06-24T14:19:17Z
Rew
3
/* BESC -- BitWizard ESC */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly (or not (*)) immediately.
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
(*) it blows up trust me, just maybe not spectacularly.
8bee6390e3dde34faadfc6d659ba6642b034943b
4184
4183
2017-06-24T14:20:05Z
Rew
3
/* warnings */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
(*) it blows up trust me, just maybe not spectacularly.
3deb862996f11e5ed2a668b648cff1e412c370f8
4185
4184
2017-06-24T14:28:09Z
Rew
3
/* connecting the motor and the battery */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
=== Software ===
I'm on branch "cr" of rewolff/bldc-bw.git on github. Doublecheck that
conf_general.h has "BW2" as the hardware selected.
I have never used Benjamins bootloader. Connect the board to the PC. Next
power up the board. Now press-and-hold the boot
button, press-and-release the reset button, and release the boot
button. Now the CPU is in USB bootloader mode.
I use
dfu-util -a 0 -D build/BLDC_4_ChibiOS.dfu
to upload new firmware. use
make build/BLDC_4_ChibiOS.dfu
to build the required file.
To control the BESC use Benjamins BLDC-tool software.
f975140b4c02945e5d4f335d20aa7752a4854cc8
4186
4185
2017-06-25T12:32:49Z
Rew
3
/* Software */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
=== Software and updating ===
I'm on branch "cr" of rewolff/bldc-bw.git on github. Doublecheck that
conf_general.h has "BW2" as the hardware selected.
I have never used Benjamins bootloader. Connect the board to the PC. Next
power up the board. Now press-and-hold the boot
button, press-and-release the reset button, and release the boot
button. Now the CPU is in USB bootloader mode.
I use
dfu-util -a 0 -D build/BLDC_4_ChibiOS.dfu
to upload new firmware. use
make build/BLDC_4_ChibiOS.dfu
to build the required file.
To control the BESC use Benjamins BLDC-tool software.
022b4e4f17d0cff3c3c6332fd9155200f4020125
4187
4186
2017-06-25T12:33:23Z
Rew
3
/* Software and updating */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
=== Software and updating ===
I'm on branch "cr" of rewolff/bldc-bw.git on github. (I don't remembery why I created that branch. Todo: figure that out). Doublecheck that conf_general.h has "BW2" as the hardware selected. That's the version that is being sold.
I have never used Benjamins bootloader. Connect the board to the PC. Next
power up the board. Now press-and-hold the boot
button, press-and-release the reset button, and release the boot
button. Now the CPU is in USB bootloader mode.
I use
dfu-util -a 0 -D build/BLDC_4_ChibiOS.dfu
to upload new firmware. use
make build/BLDC_4_ChibiOS.dfu
to build the required file.
To control the BESC use Benjamins BLDC-tool software.
b32d7b8078cb14e7de81a12be9b721b4f84aa749
Bridgeclock
0
1701
4205
4204
2017-08-22T17:16:24Z
Rew
3
/* Changing the volume */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost are used to mount the Bridgetimer on a wall, the outermost is used for field upgrades of the firmware. The innermost (closest to the speaker) is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is being developed).
caf75fff86294a81d42acd3f652910396dd1e414
4206
4205
2017-08-22T17:18:51Z
Rew
3
/* Technical details */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost are used to mount the Bridgetimer on a wall, the outermost is used for field upgrades of the firmware. The innermost (closest to the speaker) is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older (or newer) model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is still under development).
92f7928e319119076009ad61b06fe60c429a9a89
Bridgetimer
0
1992
4207
2017-08-24T12:58:04Z
Daniel L
2607
/* Bridgetimer */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost are used to mount the Bridgetimer on a wall, the outermost is used for field upgrades of the firmware. The innermost (closest to the speaker) is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older (or newer) model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is still under development).
92f7928e319119076009ad61b06fe60c429a9a89
4208
4207
2017-08-24T13:30:54Z
Daniel L
2607
/* Features */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
[[File:Bridgeklok_EN.png]]
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost are used to mount the Bridgetimer on a wall, the outermost is used for field upgrades of the firmware. The innermost (closest to the speaker) is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older (or newer) model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is still under development).
550163357d36281720ec3f2117c92c847e543592
4210
4208
2017-08-24T13:32:49Z
Daniel L
2607
/* Features */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
[[File:Bridgeklok_EN.png|thumb|300px|]]
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost are used to mount the Bridgetimer on a wall, the outermost is used for field upgrades of the firmware. The innermost (closest to the speaker) is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older (or newer) model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is still under development).
5435ea7b7292a0803e6427416240335df33ff882
4211
4210
2017-08-24T13:33:49Z
Daniel L
2607
/* Features */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
[[File:Bridgeklok_EN.png|600 px|]]
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost are used to mount the Bridgetimer on a wall, the outermost is used for field upgrades of the firmware. The innermost (closest to the speaker) is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The clock runs on 15V, not 12. The led segments require 12V of running voltage, and there needs to be some margin for the current source circuitry to work.
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older (or newer) model than the master, this will not affect performance).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is still under development).
58a99b7ddf77a3234473f600c578b1d9e6b42b83
File:Bridgeklok EN.png
6
1993
4209
2017-08-24T13:31:12Z
Daniel L
2607
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Motor
0
658
4212
4033
2017-09-07T12:51:28Z
Rew
3
/* Datasheets */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board. That can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/motor BitWizard shop].
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
Note: Each time we need to order new FETs it turns out the manufacturers have improved and that we can get better fets at a lower price. So... you might have FETs with better specs than these.
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 10V to 14V power supply. Please refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2. The motor voltage is used to drive the FETs
|-
| >14V || Jumper on pins 2 and 3. The onboard regulator generates 12V from the motor voltage.
|}
If a FET is built to use 12V gate voltages, it will only conduct partially when you drive it with lower voltages. The FET would run hot or self-destruct very quickly if that happens. So to prevent this from happening the FET-driver will not drive the FET at all if the gate-drive-voltage is not above 8V. That is why even if your motor runs on 5V you cannot use 5V for the gate-drive-voltage.
=== LEDs ===
The only LED is a power LED.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
3430c0521f1c35b0a64e7a89a1462125886668d3
4214
4212
2017-09-09T07:12:44Z
Rew
3
/* Overview */
wikitext
text/x-wiki
[[File:SPI_motor.jpg|thumb|300px|alt=The SPI_motor PCB|The SPI_motor PCB]]
This is the documentation page for the SPI_motor board. That can be bought in the [http://www.bitwizard.nl/shop/expansion-boards/motor BitWizard shop].
== Overview ==
This board is designed to control the direction and speed of two regular (brushed) DC motors, or one stepper motor.<br>
It is of course also possible to (ab)use this board to control other loads, such as pumps, fans, Peltier Elements, lightbulbs, etc.
You can buy this board [https://www.bitwizard.nl/shop/Motor in our shop]
== Assembly instructions ==
None: the board comes fully assembled.
== Specifications ==
Board size: 50mm x 50mm<br>
Maximum motor voltage: 24V<br>
Maximum motor current: 5A or 15A, depending on your version<br>
=== Possible Configurations ===
We ship two different versions of this device; a 5A version, and a 15A version.
== External resources ==
=== Datasheets ===
* [http://www.atmel.com/Images/doc2545.pdf The CPU]
* [http://www.ti.com/lit/gpn/lm5109b The FET driver]
* [http://www.fairchildsemi.com/ds/FD/FDS8884.pdf The 5A FETs]
* [http://www.vishay.com/docs/65709/sij458dp.pdf The 15A FETs]
Note: Each time we need to order new FETs it turns out the manufacturers have improved and that we can get better fets at a lower price. So... you might have FETs with better specs than these.
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
The output connector is connected as follows: <br>
(Looking at the business end of the connector, counting from left to right)
{| border=1
! pin !! function
|-
| 1 || Output B1
|-
| 2 || Output B2
|-
| 3 || Output A1
|-
| 4 || Output A2
|-
| 5 || GND
|-
| 6 || Vin
|}
=== Jumper ===
The FET drivers need a 10V to 14V power supply. Please refer to the following table for the correct jumper settings:<br>
{| border=1
! Motor voltage !! jumper setting
|-
| <10V || No jumper, external 10V to 14V power source connected to pin 2
|-
| 10V to 14V || Jumper on pins 1 and 2. The motor voltage is used to drive the FETs
|-
| >14V || Jumper on pins 2 and 3. The onboard regulator generates 12V from the motor voltage.
|}
If a FET is built to use 12V gate voltages, it will only conduct partially when you drive it with lower voltages. The FET would run hot or self-destruct very quickly if that happens. So to prevent this from happening the FET-driver will not drive the FET at all if the gate-drive-voltage is not above 8V. That is why even if your motor runs on 5V you cannot use 5V for the gate-drive-voltage.
=== LEDs ===
The only LED is a power LED.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make connector SPI1 (nearest to the board edge) into the ICSP programming connector for the ATmegaxx8 on the board.
== Protocol ==
For the intro to the SPI and I2C protocols read: [[SPI versus I2C protocols]]
The board specific protocol can be found here: [[Motor protocol]]
You should also read the [[General_SPI_protocol]] notes.
<br>
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software|the BitWizard software download directory] .<br>
<br>
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the DIO, 3FETS and 7FETS boards as well.<br>
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
TODO: write a library to make handling this board easy.
== Changelog ==
=== 1.0 ===
* Initial public release
f52e4e7f5fec0a5cecc645e253c2f15da38c71c6
Dmx interface for raspberry pi
0
1968
4219
4170
2017-11-15T23:15:37Z
Rew
3
/* Jessie */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
0bbe19ec8adeb112fa9b94e3845cc33a378918c4
4234
4219
2017-12-08T13:19:20Z
Rew
3
/* QLC+ */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The '''DMX interface for raspberry pi''' allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
d618479422e0da4ab67d7f906d989c4cb02ab60f
4256
4234
2017-12-29T18:06:52Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also a version "with FT245" That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
897351e0a581dbf3b0836e32bb9d9c07aea3292f
4257
4256
2017-12-29T18:08:27Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
bdfe6e4a7dbac001906f2aae0eb67ad75f747ead
4258
4257
2017-12-29T18:08:43Z
Rew
3
/* Introduction */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
a3d99a92a5bd32b31309b5cc2437af34e8ab149b
4352
4258
2018-06-11T11:00:03Z
Rew
3
/* OLA */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== Case ==
[[Assembling_the_DMX_case]]
462f96f890eff147cb969e95f4326c3fe7f9d1f3
4441
4352
2018-10-18T07:27:34Z
Rew
3
/* Hardware */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== Case ==
[[Assembling_the_DMX_case]]
3594907e80ece56ade7f8b26512ac7507acbadb6
4504
4441
2019-03-17T11:55:06Z
Rew
3
/* Hardware */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
[[Assembling_the_DMX_case]]
beddb9eafc90f1ae09d2bb4c41dcaa15b13a64b3
4505
4504
2019-03-17T11:55:57Z
Rew
3
/* Case */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
if [ $# -lt 1 ] ; then
echo 'on or off?'
exit 1
fi
if [ ! -d /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio18/direction
echo $1 > /sys/class/gpio/gpio18/value
then calling the script:
sudo set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
d3d0b07b952c7a3548f2f78ac612c90e3c8f84f5
Besc
0
1986
4221
4187
2017-11-18T11:08:51Z
Rew
3
/* Software and updating */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
=== Software and updating ===
I'm on branch "cr" of rewolff/bldc-bw.git on github. (I don't remembery why I created that branch. Todo: figure that out). Doublecheck that conf_general.h has "BW2" as the hardware selected. That's the version that is being sold.
I have never used Benjamins bootloader. Connect the board to the PC. Next
power up the board. Now press-and-hold the boot
button, press-and-release the reset button, and release the boot
button. Now the CPU is in USB bootloader mode.
I use
dfu-util -a 0 -D build/BLDC_4_ChibiOS.dfu
to upload new firmware. use
make build/BLDC_4_ChibiOS.dfu
to build the required file.
To control the BESC use Benjamins VESC-tool software. Download it at https://vesc-project.com
=== connections on the main board ===
==== SV1: PWM ====
SV1 is meant for PWM input or output.
* 1 GND
* 2 +5V
* 3 signal
Benjamin recommends something like changing the resistor on the board when changing from input to output. On the BESC, an 1k resistor is used. This is fine for input and should work for output as well. Let me know if you use it and find out otherwise. If you want to change the resistor, follow the trace and you find R40.
In case you're configuring the software. The pin is connected to PB12 on the CPU.
==== UART ====
* 1 GND
* 2 RX PC7
* 3 TX PC6
* 4 VCCIO
You can select the voltage on the power pin with the solder jumper near pin 4 of the uart connector. Currently there is no default. That would leave pin 4 unconnected until you drop a solder blob on one of the sides of that solder jumper.
==== SWD ====
The SWD connector mirrors the SWD connector available on ST's Discovery and Nucleo boards. If all else fails, you can program your board through this connector with a nucleo.
* 1 3.3V
* 2 SWCLK
* 3 GND
* 4 SWDAT
* 5 NRST
* 6 NC
==== HALL ====
The hall sensor connector has the following pinout:
* 1 GND
* 2 HALL 3
* 3 HALL 2
* 4 HALL 1
* 5 TEMP
* 6 +5V.
The temp sensor is connected to the temp sensor (MCP9700 ) on the FET board So alas, no separate motor/fet temperature sensing. :-(
To be compatible with 5V hall sensors (most of them) there is a 10k resistor between the pin and the CPU. This would have helped make the input 5V tolerant if the CPU didn't already have 5V tolerance on the relevant pins. There is also a pullup to 5V on the connector side. This allows the use of open collector (or open drain) output hall sensors. The pullup is 10k.
==== CAN ====
The CAN connector has the following pinout:
* 1 GND
* 2 CAN_L
* 3 CAN_H
* 4 +5V
I have not tested the can functionality yet.
==== CS ====
This is a debugging connector for "other current sensing techniques". Your board may not have it.
Pinout is:
* 1 GND
* 2 CS_A
* 3 CS_B
* 4 CS_C
* 5 VCCIO
The VCCIO is again locally selectable with a solder jumper.
If you want to monitor the current sense signal here, that would be an option.
==== u6 ====
The board has a builtin 60V -> 12V DCDC converter centered around U10. To probe the motor voltage, or 12V you can use the U6 footprint. I also use it on "higher voltage" experiments where the 60V of the DCDC converter there is insufficient. There are two options: An external say 100V DCDC converter or externally provide 12V.
* 1 VIN (VMOT)
* 2 GND
* 3 12V
due to using standard resistor values, the 12V on the board comes out to 11.89V IIRC.
==== SPI ====
The SPI connector uses ATMELS ICSP pinout. Search this wiki (or google it) for the exact pinout.
The power supply voltage is selectable with the solder jumper below it.
I have a 20x4 SPI LCD display on my bike with speed, voltage, motor/battery current and FET temperature.
For experimentation with higher voltage
8353d500569a9e555874cdd153f37e3ebee07cb1
4222
4221
2017-11-18T12:18:01Z
Rew
3
/* SPI */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
=== Software and updating ===
I'm on branch "cr" of rewolff/bldc-bw.git on github. (I don't remembery why I created that branch. Todo: figure that out). Doublecheck that conf_general.h has "BW2" as the hardware selected. That's the version that is being sold.
I have never used Benjamins bootloader. Connect the board to the PC. Next
power up the board. Now press-and-hold the boot
button, press-and-release the reset button, and release the boot
button. Now the CPU is in USB bootloader mode.
I use
dfu-util -a 0 -D build/BLDC_4_ChibiOS.dfu
to upload new firmware. use
make build/BLDC_4_ChibiOS.dfu
to build the required file.
To control the BESC use Benjamins VESC-tool software. Download it at https://vesc-project.com
=== connections on the main board ===
==== SV1: PWM ====
SV1 is meant for PWM input or output.
* 1 GND
* 2 +5V
* 3 signal
Benjamin recommends something like changing the resistor on the board when changing from input to output. On the BESC, an 1k resistor is used. This is fine for input and should work for output as well. Let me know if you use it and find out otherwise. If you want to change the resistor, follow the trace and you find R40.
In case you're configuring the software. The pin is connected to PB12 on the CPU.
==== UART ====
* 1 GND
* 2 RX PC7
* 3 TX PC6
* 4 VCCIO
You can select the voltage on the power pin with the solder jumper near pin 4 of the uart connector. Currently there is no default. That would leave pin 4 unconnected until you drop a solder blob on one of the sides of that solder jumper.
==== SWD ====
The SWD connector mirrors the SWD connector available on ST's Discovery and Nucleo boards. If all else fails, you can program your board through this connector with a nucleo.
* 1 3.3V
* 2 SWCLK
* 3 GND
* 4 SWDAT
* 5 NRST
* 6 NC
==== HALL ====
The hall sensor connector has the following pinout:
* 1 GND
* 2 HALL 3
* 3 HALL 2
* 4 HALL 1
* 5 TEMP
* 6 +5V.
The temp sensor is connected to the temp sensor (MCP9700 ) on the FET board So alas, no separate motor/fet temperature sensing. :-(
To be compatible with 5V hall sensors (most of them) there is a 10k resistor between the pin and the CPU. This would have helped make the input 5V tolerant if the CPU didn't already have 5V tolerance on the relevant pins. There is also a pullup to 5V on the connector side. This allows the use of open collector (or open drain) output hall sensors. The pullup is 10k.
==== CAN ====
The CAN connector has the following pinout:
* 1 GND
* 2 CAN_L
* 3 CAN_H
* 4 +5V
I have not tested the can functionality yet.
==== CS ====
This is a debugging connector for "other current sensing techniques". Your board may not have it.
Pinout is:
* 1 GND
* 2 CS_A
* 3 CS_B
* 4 CS_C
* 5 VCCIO
The VCCIO is again locally selectable with a solder jumper.
If you want to monitor the current sense signal here, that would be an option.
==== u6 ====
The board has a builtin 60V -> 12V DCDC converter centered around U10. To probe the motor voltage, or 12V you can use the U6 footprint. I also use it on "higher voltage" experiments where the 60V of the DCDC converter there is insufficient. There are two options: An external say 100V DCDC converter or externally provide 12V.
* 1 VIN (VMOT)
* 2 GND
* 3 12V
due to using standard resistor values, the 12V on the board comes out to 11.89V IIRC.
==== SPI ====
The SPI connector uses ATMELS ICSP pinout. Search this wiki (or google it) for the exact pinout.
The power supply voltage is selectable with the solder jumper below it.
I have a 20x4 SPI LCD display on my bike with speed, voltage, motor/battery current and FET temperature.
46e4e8e3e5b53b0115367a80cc9341ba4e40a20c
4286
4222
2018-04-24T16:04:25Z
Rew
3
/* connections on the main board */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
=== Software and updating ===
I'm on branch "cr" of rewolff/bldc-bw.git on github. (I don't remembery why I created that branch. Todo: figure that out). Doublecheck that conf_general.h has "BW2" as the hardware selected. That's the version that is being sold.
I have never used Benjamins bootloader. Connect the board to the PC. Next
power up the board. Now press-and-hold the boot
button, press-and-release the reset button, and release the boot
button. Now the CPU is in USB bootloader mode.
I use
dfu-util -a 0 -D build/BLDC_4_ChibiOS.dfu
to upload new firmware. use
make build/BLDC_4_ChibiOS.dfu
to build the required file.
To control the BESC use Benjamins VESC-tool software. Download it at https://vesc-project.com
=== connections on the main board ===
==== EXT ====
This is the analog input port
* 1 GND
* 2 AIN 1 0-5V (a 4k7/10k resistor divider connects this to the input on the CPU)
* 3 AIN 2 0-3.3V (directly connected to the CPU: do not exceed 3.3V).
* 4
==== SV1: PWM ====
SV1 is meant for PWM input or output.
* 1 GND
* 2 +5V
* 3 signal
Benjamin recommends something like changing the resistor on the board when changing from input to output. On the BESC, an 1k resistor is used. This is fine for input and should work for output as well. Let me know if you use it and find out otherwise. If you want to change the resistor, follow the trace and you find R40.
In case you're configuring the software. The pin is connected to PB12 on the CPU.
==== UART ====
* 1 GND
* 2 RX PC7
* 3 TX PC6
* 4 VCCIO
You can select the voltage on the power pin with the solder jumper near pin 4 of the uart connector. Currently there is no default. That would leave pin 4 unconnected until you drop a solder blob on one of the sides of that solder jumper.
==== SWD ====
The SWD connector mirrors the SWD connector available on ST's Discovery and Nucleo boards. If all else fails, you can program your board through this connector with a nucleo.
* 1 3.3V
* 2 SWCLK
* 3 GND
* 4 SWDAT
* 5 NRST
* 6 NC
==== HALL ====
The hall sensor connector has the following pinout:
* 1 GND
* 2 HALL 3
* 3 HALL 2
* 4 HALL 1
* 5 TEMP
* 6 +5V.
The temp sensor is connected to the temp sensor (MCP9700 ) on the FET board So alas, no separate motor/fet temperature sensing. :-(
To be compatible with 5V hall sensors (most of them) there is a 10k resistor between the pin and the CPU. This would have helped make the input 5V tolerant if the CPU didn't already have 5V tolerance on the relevant pins. There is also a pullup to 5V on the connector side. This allows the use of open collector (or open drain) output hall sensors. The pullup is 10k.
==== CAN ====
The CAN connector has the following pinout:
* 1 GND
* 2 CAN_L
* 3 CAN_H
* 4 +5V
I have not tested the can functionality yet.
==== CS ====
This is a debugging connector for "other current sensing techniques". Your board may not have it.
Pinout is:
* 1 GND
* 2 CS_A
* 3 CS_B
* 4 CS_C
* 5 VCCIO
The VCCIO is again locally selectable with a solder jumper.
If you want to monitor the current sense signal here, that would be an option.
==== u6 ====
The board has a builtin 60V -> 12V DCDC converter centered around U10. To probe the motor voltage, or 12V you can use the U6 footprint. I also use it on "higher voltage" experiments where the 60V of the DCDC converter there is insufficient. There are two options: An external say 100V DCDC converter or externally provide 12V.
* 1 VIN (VMOT)
* 2 GND
* 3 12V
due to using standard resistor values, the 12V on the board comes out to 11.89V IIRC.
==== SPI ====
The SPI connector uses ATMELS ICSP pinout. Search this wiki (or google it) for the exact pinout.
The power supply voltage is selectable with the solder jumper below it.
I have a 20x4 SPI LCD display on my bike with speed, voltage, motor/battery current and FET temperature.
ae610f3847a6f1b99375d78cb14415984a2e0657
4287
4286
2018-04-24T16:04:38Z
Rew
3
/* EXT */
wikitext
text/x-wiki
= BESC -- BitWizard ESC =
== introduction ==
The BitWizard ESC is based on Benjamin Vedder's VESC. The BESC has as advantages that the FETS are better positioned so that they can be cooled. A disadvantage is that it is slightly larger so it takes a bit more space.
== getting started ==
=== warnings ===
Power electronics is finicky stuff. Create a short somewhere and things blow up spectacularly immediately (or not (*)).
The BESC shuts down permanently when:
* you connect the two sub-boards shifted one pin. Don't ask how I know.
* the connector between both boards comes
loose. if your enclosure does not force the boards together, consider a tiewrap to keep them together.
* In cardboard box, riding at 15A continuous for 20 minutes causes the board to overheat. Or at least enter thermal slowdown.
(*) it blows up trust me, just maybe not spectacularly.
=== connecting the motor and the battery ===
The power board needs connections to the motor and to the battery.
There are three obvious
places for the motor wires. Right? Those are near a TAB for a FET.
You MAY connect to that tab as well. There are 6-and-a-half feet of
the other fet nearby. The leftmost is the gate. Do not short
there. The middle, shorter one is the V+. Do not short there. That
leaves five legs of the transistor that you're allowed to solder to.
This last option is the easiest. Before powering it up: PLEASE check
that you don't have any shorts. Check for shorts from the motor wires
to both supply pins and to the gates of the highside FETs.
If you have the power-board right-side-up, you'll have the battery
connections nearest yourself, the pin header on the right. The left
battery connection is the battery +, the right one is the ground.
Double check: The battery + is connected to all three tabs of the high
side fets. Those are the tabs nearest the PCB edge. The battery - is
connected to all three shunt resistors. (according to your multimeter:
both sides ;-) ).
Keep the capacitors as close as possible to the board. Consider
soldering them between the ground side of the shunt resistors and the
tabs of the high-side fets.
The back of the power board is meant for cooling. At 20A max current,
and riding 18 minutes at 15A I heated my board into thermal slowdown
yesterday night. I should get a bit better cooling for my own bike.
If you're going to cool that side of the PCB, make sure your wires do
not protrude through the PCB, or short against the heatsink.
=== Software and updating ===
I'm on branch "cr" of rewolff/bldc-bw.git on github. (I don't remembery why I created that branch. Todo: figure that out). Doublecheck that conf_general.h has "BW2" as the hardware selected. That's the version that is being sold.
I have never used Benjamins bootloader. Connect the board to the PC. Next
power up the board. Now press-and-hold the boot
button, press-and-release the reset button, and release the boot
button. Now the CPU is in USB bootloader mode.
I use
dfu-util -a 0 -D build/BLDC_4_ChibiOS.dfu
to upload new firmware. use
make build/BLDC_4_ChibiOS.dfu
to build the required file.
To control the BESC use Benjamins VESC-tool software. Download it at https://vesc-project.com
=== connections on the main board ===
==== EXT ====
This is the analog input port
* 1 GND
* 2 AIN 1 0-5V (a 4k7/10k resistor divider connects this to the input on the CPU)
* 3 AIN 2 0-3.3V (directly connected to the CPU: do not exceed 3.3V).
* 4 5V
==== SV1: PWM ====
SV1 is meant for PWM input or output.
* 1 GND
* 2 +5V
* 3 signal
Benjamin recommends something like changing the resistor on the board when changing from input to output. On the BESC, an 1k resistor is used. This is fine for input and should work for output as well. Let me know if you use it and find out otherwise. If you want to change the resistor, follow the trace and you find R40.
In case you're configuring the software. The pin is connected to PB12 on the CPU.
==== UART ====
* 1 GND
* 2 RX PC7
* 3 TX PC6
* 4 VCCIO
You can select the voltage on the power pin with the solder jumper near pin 4 of the uart connector. Currently there is no default. That would leave pin 4 unconnected until you drop a solder blob on one of the sides of that solder jumper.
==== SWD ====
The SWD connector mirrors the SWD connector available on ST's Discovery and Nucleo boards. If all else fails, you can program your board through this connector with a nucleo.
* 1 3.3V
* 2 SWCLK
* 3 GND
* 4 SWDAT
* 5 NRST
* 6 NC
==== HALL ====
The hall sensor connector has the following pinout:
* 1 GND
* 2 HALL 3
* 3 HALL 2
* 4 HALL 1
* 5 TEMP
* 6 +5V.
The temp sensor is connected to the temp sensor (MCP9700 ) on the FET board So alas, no separate motor/fet temperature sensing. :-(
To be compatible with 5V hall sensors (most of them) there is a 10k resistor between the pin and the CPU. This would have helped make the input 5V tolerant if the CPU didn't already have 5V tolerance on the relevant pins. There is also a pullup to 5V on the connector side. This allows the use of open collector (or open drain) output hall sensors. The pullup is 10k.
==== CAN ====
The CAN connector has the following pinout:
* 1 GND
* 2 CAN_L
* 3 CAN_H
* 4 +5V
I have not tested the can functionality yet.
==== CS ====
This is a debugging connector for "other current sensing techniques". Your board may not have it.
Pinout is:
* 1 GND
* 2 CS_A
* 3 CS_B
* 4 CS_C
* 5 VCCIO
The VCCIO is again locally selectable with a solder jumper.
If you want to monitor the current sense signal here, that would be an option.
==== u6 ====
The board has a builtin 60V -> 12V DCDC converter centered around U10. To probe the motor voltage, or 12V you can use the U6 footprint. I also use it on "higher voltage" experiments where the 60V of the DCDC converter there is insufficient. There are two options: An external say 100V DCDC converter or externally provide 12V.
* 1 VIN (VMOT)
* 2 GND
* 3 12V
due to using standard resistor values, the 12V on the board comes out to 11.89V IIRC.
==== SPI ====
The SPI connector uses ATMELS ICSP pinout. Search this wiki (or google it) for the exact pinout.
The power supply voltage is selectable with the solder jumper below it.
I have a 20x4 SPI LCD display on my bike with speed, voltage, motor/battery current and FET temperature.
61d43da7fa3609082eb1690eefd6bd1afb51b4db
Using SPI modules with an arduino
0
1980
4259
4089
2018-01-16T13:55:41Z
Rew
3
/* software */
wikitext
text/x-wiki
= intro =
It is very convenient to expand your arduino with the bitwizard I2C or SPI modules. This article focuses on the SPI variant.
== hardware ==
To connect your bitwizard module to your arduino I prefer to use the connector on the arduino that is originally for ICSP. Almost all the SPI signals are there. And we chose the pinout to be the same as well.
The only signal that does not appear on the ICSP connector is the "slave select" signal. The ICSP connector has "RESET" there.
So use the following connection:
arduino bitwizard
ICSP SPI
1 1
2 2
3 3
4 4
6 6
[todo find the names of the signals]
This leaves SS/RESET. We cannot use the RESET line on the ICSP connector. We recommend you use the D10 pin of the arduino as that is the pin recommended for the purpose by the chip manufacturer Atmel. So:
arduino bitwizard
SPI
D10 5
== software ==
This example uses the BIGRELAY module, and rotates through the six relays each time you press the button.
(no relays are activated until you first press the button. )
const int SPICLK = 13;
const int SPIMOSI = 11;
const int SPIMISO = 12;
const int SPISS = 10;
const int myswitch = 9;
void SPIinit(void)
{
pinMode (SPICLK, OUTPUT);
pinMode (SPIMOSI, OUTPUT);
pinMode (SPIMISO, OUTPUT);
pinMode (SPISS, OUTPUT);
digitalWrite (SPISS, 1);
SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR1) | _BV(SPR0);
}
char SPI(char d)
{ // send character over SPI
char received = 0;
SPDR = d;
while(!(SPSR & _BV(SPIF)));
received = SPDR;
return (received);
}
void SPI_startpkt (void)
{
digitalWrite (SPISS, 0);
}
void SPI_endpkt (void)
{
digitalWrite (SPISS, 1);
}
static unsigned char bigrelay = 0x9c;
#define WAIT1 25
#define WAIT2 15
void setregval (unsigned char addr, unsigned char reg, unsigned char val)
{
SPI_startpkt ();
delayMicroseconds (WAIT1);
SPI (addr);
delayMicroseconds (WAIT2);
SPI (reg);
delayMicroseconds (WAIT2);
SPI (val);
SPI_endpkt ();
}
void setup (void)
{
int i;
SPIinit ();
pinMode (myswitch, INPUT_PULLUP);
}
//#define USE_SWITCH
#ifdef USE_SWITCH
#define DOIT digitalRead (myswitch) == 0
#else
#define DOIT 1
#endif
void loop (void)
{
static int r;
if (DOIT) {
setregval (bigrelay, 0x10, 1 << r);
#ifdef USE_SWITCH
delay (10); // debounce
while (digitalRead (myswitch) == 0)
/* nothing */ ;
delay (10); // debounce.
#else
delay (500);
#endif
r = r + 1;
if (r == 6) r = 0;
}
}
87aa7088a422089a788474a7158574a3e8c5792a
Bridgeklok
0
1984
4268
4181
2018-03-14T12:04:41Z
Rew
3
/* Technische details */
wikitext
text/x-wiki
= Bridgeklok =
== Introductie ==
Een bridgezitting bestaat uit een aantal rondes met tussen de rondes een korte pauze om van tafel te wisselen. De bridgeklok telt de tijd af die zo'n ronde en de daarop volgende wissel periode duurt en geeft daarbij een aantal geluidssignalen:
* Beginsignaal van de ronde (einde van de wisseltijd)
* Waarschuwingssignaal nadering einde ronde
* Eindsignaal van de ronde, tevens begin van de wisseltijd
== Kenmerken ==
De BitWizard Bridgeklok heeft als kenmerken:
* Groot, goed leesbaar display.
* Zichtbaar verschil tussen "resterende rondetijd" en "resterende wisseltijd".
* Verschillende geluidsignalen voor "einde ronde", "waarschuwing, einde ronde nadert" ("laatste spel!" bij sommige clubs) en "start nieuwe ronde".
* Vier voorkeuze programmas. U kunt snel wisselen tussen verschillende instellingen. Bijvoorbeeld voor een beginnersavond waarbij de rondes langer zijn.
* Eenvoudig te gebruiken interface om aanpassingen te doen.
* Mogelijkheid om de lopende ronde/wisseltijd direct aan te passen.
== Bedieningselementen ==
[[File:Bridgeklok_edit.png|600px]]
Omdat de ruimte voor de naampjes van de knoppen beperkt is, is gekozen voor korte namen. Vooral de '''pause''' (5) knop dekt niet geheel de lading. Het is eigenlijk '''start/stop'''.
== Aan de slag ==
De bridgeklok is eenvoudig in gebruik. Gewoon de adapter in de klok en in het stopcontact steken, de klok aanzetten met de aan/uit schakelaar (1) en hij begint te lopen op 10 seconden resterende wisseltijd. Deze tien seconden geven u de tijd om eventueel een langere resterende wisseltijd in te stellen (zie hieronder).
De klok start altijd op in programma P1. Standaard staan alle programma’s ingesteld op 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
U kunt een ander programma selecteren door op mode (2) te drukken en vervolgens met behulp van up (3) en down (4) een ander programma te selecteren. Het programma kan vervolgens gestart worden met de pause (run) knop (5).
U kunt de klok pauzeren en vervolgens hervatten met de pause (5) knop.
Als het nodig is om de huidige ronde- of wisseltijd te verlengen (in stappen van 1 minuut) dan is dat simpel te regelen door op '''up''' (3) te drukken. Ook is het mogelijk om de ronde- of wisseltijd in stappen van 1 minuut te verkorten door op '''down''' (4) te drukken.
Bij het naderen van het einde van de ronde klinkt er een waarschuwingssignaal.
Een ander geluid klinkt bij het einde van de ronde.
Een derde signaal klinkt als de wisseltijd voorbij is en de volgende ronde begint.
Gedurende de wisseltijd is er links in het display een enkel segment dat "rondloopt" en het rondlopen van de spelers symboliseert. Zo is het verschil te zien tussen wisseltijd en speeltijd.
== Programma instellen ==
Om de keuzeprogramma’s in te stellen, drukt u eerst op '''mode''' (2).
Met de '''up''' (3) en '''down''' (4) knoppen kunt u vervolgens het keuzeprogramma selecteren. Deze worden als P1 tot en met P4 weergegeven.
Om het gekozen programma te starten drukt u op '''pause''' (5).
U kunt ook het programma bekijken of aanpassen door nogmaals op '''mode''' (2) te drukken.
Voor ieder programma kunnen achtereenvolgens drie tijden ingesteld worden: de speeltijd, de waarschuwingstijd en de wisseltijd. Standaard is 30 minuten speeltijd, 5 minuten waarschuwingstijd en 3 minuten wisseltijd.
De tijden worden met de '''up''' (3) en '''down''' (4) knoppen ingesteld. De wisseltijd wordt in stappen van 20 seconden ingesteld, de speeltijd en waarschuwingstijd in stappen van 1 minuut.
Door nogmaals op '''mode''' (2) drukken gaat u verder naar de instelling van de volgende tijd. Na "wisseltijd" komt u weer in "programma selectie". Om het programma te starten drukt u op '''pause''' (5).
Veranderingen worden automatisch opgeslagen.
De bridgeklok start altijd op met programma P1 omdat als twee clubs die om en om spelen de klok zouden delen met verschillende instellingen, hij dan altijd verkeerd zou staan als hij de laatste stand zou onthouden. Door steeds op P1 te beginnen is er een kans dat hij in sommige gevallen goed staat.
Als u de enige gebruiker van de klok bent en vrijwel altijd hetzelfde programma gebruikt, dan kunt u dat op P1 instellen. U kunt dan gewoon de klok starten en eventueel de eerste wisseltijd of -speeltijd iets aanpassen.
Als u een enkele keer een ander programma nodig heeft, dan doet u dat op P2. Zo hoeft u niets terug te veranderen voor het normale speelmoment.
Als u de klok regelmatig gebruikt voor een drive die andere instellingen nodig heeft, dan raad ik aan om uw normale instellingen in P2 en P3 (en zo nodig hoger) op te slaan. Ervaring leert dat hulpvaardige handen tijdens de drive vaak aan P1 gaan zitten rommelen, maar de hogere programma’s blijven dan gelukkig bewaard.
== Helderheid instellen ==
Om de helderheid van het display te veranderen, zet u de klok uit. Houdt vervolgens de '''pause''' knop (5) ingedrukt terwijl u de klok aanzet. Er verschijnt nu een "I" in het display, samen met de huidige instelling (I van het engelse '''I'''ntensity, of '''I'''nstellen helderheid).
De standaard helderheid is 20. Met behulp van de '''up''' (3) en '''down''' (4) knoppen kunt u de huidige waarde veranderen tussen de 0 en de 99 in stapjes van drie. Om de bridgeklok te starten, drukt u op '''mode''' (2) of '''pause''' (5).
'''Let op''': op de allerlaagste standen gaat het display knipperen, dus die kunt u beter niet gebruiken! De standaardinstelling van 20 is ietwat donker, een instelling van ongeveer 30 bevalt ons in de praktijk prima. Overdag of buiten kan een hogere instelling nodig zijn.
== Feedback ==
BitWizard is een klein elektronicabedrijfje met aan het hoofd een bridgespeler. Toen zijn bridgeclub een nieuwe bridgeklok wilde hebben, hebben we er eentje ontworpen en gebouwd.
Wij zijn niet gespecialiseerd in bridgeproducten en we hebben niet de middelen om een groot marktonderzoek te houden. We hebben dus gebouwd wat we zelf nodig achten en wat we denken dat anderen ook handig zullen vinden, maar mogelijk dat uw club andere eisen aan een bridgeklok stelt. Mocht u ideeën hebben voor verbetering van onze bridgeklok, laat het ons dan alstublieft weten! Wellicht kunnen we de software van uw klok aanpassen om aan uw wensen te voldoen zonder de hardware te vervangen.
We kunnen helaas niet garanderen dat we uw suggesties kunnen implementeren, maar we laten het u weten wanneer uw wens beschikbaar komt.
Enkele suggesties die al binnen gekomen zijn:
* meerdere klokken in een hoofdklok-hulpklok configuratie
* afstandsbediening.
Mocht u hier ook interesse voor hebben, geef dat dan aan ons door zodat wij een indruk krijgen van hoe groot de markt voor deze features is.
Mocht u een andere toepassing weten waar "vier grote getallen op een helder display" van nut kunnen zijn, laat het ons dan ook weten. Waarschijnlijk is de hardware al geschikt en kunnen we de software eenvoudig aanpassen voor de andere toepassing.
== Technische details ==
De nerds willen dit misschien lezen, anderen kunnen het veilig negeren.
De klok gebruikt 15V, niet het meer gebruikelijke 12V. De segmenten van de displays hebben ongeveer 12V nodig, maar er moet een stroomsturing omheen zitten die wat "marge" nodig heeft.
Indien u de klok openmaakt is er een wit-blauwe potentiometer zichtbaar, waarmee het volume ingesteld kan worden (met een klein kruiskop schroevendraaiertje).
De twee PCBs zijn identiek. De ene is als "master" geconfigureerd, de andere als slave. Zodra we V2 van de hardware in productie nemen zouden we mogelijk wat resterende V1 PCBs als slave in kunnen zetten. De master-slave interface is hetzelfde gebleven.
Versie 1 draait op een AT90USB162 microcontroller, en gebruikt de TLC59025 led driver. De segmenten zijn niet gemultiplexed. Versie 2 bevat een STM32F072 processor en dezelfde led driver. Ondertussen worden "versie 2" klokken uitgeleverd.
Mocht een firmware upgrade nodig zijn, dan kan dat. Zie [[bridgeklok upgrade]] voor instructies
2dfb082814579c502b39798e48b5438bdff60c21
Bridgeklok upgrade
0
2005
4269
2018-03-14T12:19:20Z
Rew
3
Created page with "= intro = De bridgeklok bestaat in twee versies, uiterlijk nauwelijks van mekaar te onderscheiden. Versie 1 is gebaseerd op een atmel AT90USB162. Versie 2 en volgende zijn ge..."
wikitext
text/x-wiki
= intro =
De bridgeklok bestaat in twee versies, uiterlijk nauwelijks van mekaar te onderscheiden. Versie 1 is gebaseerd op een atmel AT90USB162. Versie 2 en volgende zijn gebaseerd op een STM32F072. Zorg dat u de juiste instructies opvolgt indien u een upgrade wilt/moet uitvoeren.
== Versie 1 ==
Verwijder de voedingskabel. Sluit de bridgeklok aan op de computer met een USB kabel. Er is nu niet genoeg spanning om de normale segmenten te laten oplichten, maar wel de punten. U zult dus niets in het display zien, maar wel mogelijk een knipperende punt. Dit is normaal.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het verdient aanbeveling om eerst zonder spanning op het apparaat te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
== Versie 2 ==
Verwijder de voedingskabel.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het gaat hier om het gaatje wat een cm of twee linkonder het andere ronde gaatje zit. Het verdient aanbeveling om eerst te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Vervolgens, terwijl u het knopje ingedrukt houdt, sluit de bridgeklok aan op de computer met een USB kabel.
069918b662be7705079e9771b45bcc964f29272c
4270
4269
2018-03-14T12:48:43Z
Rew
3
/* Versie 2 */
wikitext
text/x-wiki
= intro =
De bridgeklok bestaat in twee versies, uiterlijk nauwelijks van mekaar te onderscheiden. Versie 1 is gebaseerd op een atmel AT90USB162. Versie 2 en volgende zijn gebaseerd op een STM32F072. Zorg dat u de juiste instructies opvolgt indien u een upgrade wilt/moet uitvoeren.
== Versie 1 ==
Verwijder de voedingskabel. Sluit de bridgeklok aan op de computer met een USB kabel. Er is nu niet genoeg spanning om de normale segmenten te laten oplichten, maar wel de punten. U zult dus niets in het display zien, maar wel mogelijk een knipperende punt. Dit is normaal.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het verdient aanbeveling om eerst zonder spanning op het apparaat te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
== Versie 2 ==
Verwijder de voedingskabel.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het gaat hier om het gaatje wat een cm of twee linkonder het andere ronde gaatje zit. Het verdient aanbeveling om eerst te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Vervolgens, terwijl u het knopje ingedrukt houdt, sluit U de bridgeklok aan op de computer met een USB kabel.
De klok moet zich nu melden als:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(Waar deze informatie bij moderne windows computers verstopt zit weet ik niet. Iemand die het weet mag het even doorgeven, dan zet ik het er hier bij voor de volgende mensen.) Indien U dit niet kunt vinden: geen paniek, als het niet gelukt is merken we het even verderop vanzelf.
Het apparaat moet nu via "Device Firmware Update" (DFU) van nieuwe firmware voorzien worden.
=== Linux ===
U dient het dfu-util programma te installeren. Onder Ubuntu/Debian/Rasbian gaat dat met:
sudo apt-get install dfu-util
Daarna kunt u de nieuwe firmware installeren met:
dfu-util -a 0 -D bridgeclock.dfu -s :leave
=== MS Windows ===
U kunt de software downloaden van [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll de ST website]. Aldaar op de kleine "get software" knop drukken. Deze software zou nu met het geleverde "bridgeclock.dfu" bestand en de geprepareerde klok overweg moeten kunnen om de boel te upgraden.
Dit is ST software en ST microelectronics zou daar een handleiding van geschreven moeten hebben. Die vind u op de gelinkte webpagina door iets naar boven te scrollen. Met een beetje mazzel valt er zo uit te komen.... Indien iemand de procedure succesvol volgt en notities maakt "nu hier drukken dan daar", kan dat handig zijn voor volgende mensen die de procedure willen volgen. Stuur gerust een Email met "het was makkelijk ik hoefde alleen maar .... te doen." of "Het was moeilijk ik moest eerst dit dan dat ... "
2cd777f7750e3e06e7fd1b5bc81610e4992b43a4
4271
4270
2018-03-14T12:49:22Z
Rew
3
/* Versie 1 */
wikitext
text/x-wiki
= intro =
De bridgeklok bestaat in twee versies, uiterlijk nauwelijks van mekaar te onderscheiden. Versie 1 is gebaseerd op een atmel AT90USB162. Versie 2 en volgende zijn gebaseerd op een STM32F072. Zorg dat u de juiste instructies opvolgt indien u een upgrade wilt/moet uitvoeren.
== Versie 1 ==
Verwijder de voedingskabel. Sluit de bridgeklok aan op de computer met een USB kabel. Er is nu niet genoeg spanning om de normale segmenten te laten oplichten, maar wel de punten. U zult dus niets in het display zien, maar wel mogelijk een knipperende punt. Dit is normaal.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het verdient aanbeveling om eerst zonder spanning op het apparaat te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Hoe nu verder is nog niet geschreven: Er is nog geen update voor deze versie.
== Versie 2 ==
Verwijder de voedingskabel.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het gaat hier om het gaatje wat een cm of twee linkonder het andere ronde gaatje zit. Het verdient aanbeveling om eerst te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Vervolgens, terwijl u het knopje ingedrukt houdt, sluit U de bridgeklok aan op de computer met een USB kabel.
De klok moet zich nu melden als:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(Waar deze informatie bij moderne windows computers verstopt zit weet ik niet. Iemand die het weet mag het even doorgeven, dan zet ik het er hier bij voor de volgende mensen.) Indien U dit niet kunt vinden: geen paniek, als het niet gelukt is merken we het even verderop vanzelf.
Het apparaat moet nu via "Device Firmware Update" (DFU) van nieuwe firmware voorzien worden.
=== Linux ===
U dient het dfu-util programma te installeren. Onder Ubuntu/Debian/Rasbian gaat dat met:
sudo apt-get install dfu-util
Daarna kunt u de nieuwe firmware installeren met:
dfu-util -a 0 -D bridgeclock.dfu -s :leave
=== MS Windows ===
U kunt de software downloaden van [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll de ST website]. Aldaar op de kleine "get software" knop drukken. Deze software zou nu met het geleverde "bridgeclock.dfu" bestand en de geprepareerde klok overweg moeten kunnen om de boel te upgraden.
Dit is ST software en ST microelectronics zou daar een handleiding van geschreven moeten hebben. Die vind u op de gelinkte webpagina door iets naar boven te scrollen. Met een beetje mazzel valt er zo uit te komen.... Indien iemand de procedure succesvol volgt en notities maakt "nu hier drukken dan daar", kan dat handig zijn voor volgende mensen die de procedure willen volgen. Stuur gerust een Email met "het was makkelijk ik hoefde alleen maar .... te doen." of "Het was moeilijk ik moest eerst dit dan dat ... "
8b0758dddae7b8a4387dbca9d3ba1f8eae1e81a6
4272
4271
2018-03-14T12:54:56Z
Rew
3
/* Versie 2 */
wikitext
text/x-wiki
= intro =
De bridgeklok bestaat in twee versies, uiterlijk nauwelijks van mekaar te onderscheiden. Versie 1 is gebaseerd op een atmel AT90USB162. Versie 2 en volgende zijn gebaseerd op een STM32F072. Zorg dat u de juiste instructies opvolgt indien u een upgrade wilt/moet uitvoeren.
== Versie 1 ==
Verwijder de voedingskabel. Sluit de bridgeklok aan op de computer met een USB kabel. Er is nu niet genoeg spanning om de normale segmenten te laten oplichten, maar wel de punten. U zult dus niets in het display zien, maar wel mogelijk een knipperende punt. Dit is normaal.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het verdient aanbeveling om eerst zonder spanning op het apparaat te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Hoe nu verder is nog niet geschreven: Er is nog geen update voor deze versie.
== Versie 2 ==
Verwijder de voedingskabel.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het gaat hier om het gaatje wat een cm of twee linkonder het andere ronde gaatje zit. Het verdient aanbeveling om eerst te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Vervolgens, terwijl u het knopje ingedrukt houdt, sluit U de bridgeklok aan op de computer met een USB kabel.
De klok moet zich nu melden als:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(Waar deze informatie bij moderne windows computers verstopt zit weet ik niet. Iemand die het weet mag het even doorgeven, dan zet ik het er hier bij voor de volgende mensen.) Indien U dit niet kunt vinden: geen paniek, als het niet gelukt is merken we het even verderop vanzelf.
Het apparaat moet nu via "Device Firmware Update" (DFU) van nieuwe firmware voorzien worden.
=== Linux ===
U dient het dfu-util programma te installeren. Onder Ubuntu/Debian/Rasbian gaat dat met:
sudo apt-get install dfu-util
Daarna kunt u de nieuwe firmware installeren met:
dfu-util -a 0 -D bridgeclock.dfu -s :leave
=== MS Windows ===
U kunt de software downloaden van [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll de ST website]. Aldaar op de kleine "get software" knop drukken. Deze software zou nu met het geleverde "bridgeclock.dfu" bestand en de geprepareerde klok overweg moeten kunnen om de boel te upgraden.
Dit is ST software en ST microelectronics zou daar een handleiding van geschreven moeten hebben. Die vind u op de gelinkte webpagina door iets naar boven te scrollen. Met een beetje mazzel valt er zo uit te komen.... Indien iemand de procedure succesvol volgt en notities maakt "nu hier drukken dan daar", kan dat handig zijn voor volgende mensen die de procedure willen volgen. Stuur gerust een Email met "het was makkelijk ik hoefde alleen maar .... te doen." of "Het was moeilijk ik moest eerst dit dan dat ... "
Een alternatief is om de dfu-util software te gebruiken zoals onder Linux. [http://dfu-util.sourceforge.net/ De dfu-util homepage] zegt dat er windows binaries zijn. Dat zou, eenmaal geinstalleerd vergelijkbaar moeten werken als de Linux aanwijzingen hierboven.
3407c0200c0c5c9cdf55349ec27a4516a143a661
4273
4272
2018-03-14T12:57:25Z
Rew
3
/* MS Windows */
wikitext
text/x-wiki
= intro =
De bridgeklok bestaat in twee versies, uiterlijk nauwelijks van mekaar te onderscheiden. Versie 1 is gebaseerd op een atmel AT90USB162. Versie 2 en volgende zijn gebaseerd op een STM32F072. Zorg dat u de juiste instructies opvolgt indien u een upgrade wilt/moet uitvoeren.
== Versie 1 ==
Verwijder de voedingskabel. Sluit de bridgeklok aan op de computer met een USB kabel. Er is nu niet genoeg spanning om de normale segmenten te laten oplichten, maar wel de punten. U zult dus niets in het display zien, maar wel mogelijk een knipperende punt. Dit is normaal.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het verdient aanbeveling om eerst zonder spanning op het apparaat te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Hoe nu verder is nog niet geschreven: Er is nog geen update voor deze versie.
== Versie 2 ==
Verwijder de voedingskabel.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het gaat hier om het gaatje wat een cm of twee linkonder het andere ronde gaatje zit. Het verdient aanbeveling om eerst te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Vervolgens, terwijl u het knopje ingedrukt houdt, sluit U de bridgeklok aan op de computer met een USB kabel.
De klok moet zich nu melden als:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(Waar deze informatie bij moderne windows computers verstopt zit weet ik niet. Iemand die het weet mag het even doorgeven, dan zet ik het er hier bij voor de volgende mensen.) Indien U dit niet kunt vinden: geen paniek, als het niet gelukt is merken we het even verderop vanzelf.
Het apparaat moet nu via "Device Firmware Update" (DFU) van nieuwe firmware voorzien worden.
=== Linux ===
U dient het dfu-util programma te installeren. Onder Ubuntu/Debian/Rasbian gaat dat met:
sudo apt-get install dfu-util
Daarna kunt u de nieuwe firmware installeren met:
dfu-util -a 0 -D bridgeclock.dfu -s :leave
=== MS Windows ===
U kunt de software downloaden van [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll de ST website]. Aldaar op de kleine "get software" knop drukken. Deze software zou nu met het geleverde "bridgeclock.dfu" bestand en de geprepareerde klok overweg moeten kunnen om de boel te upgraden.
Dit is ST software en ST microelectronics zou daar een handleiding van geschreven moeten hebben. Die vind u op de gelinkte webpagina door iets naar boven te scrollen. Met een beetje mazzel valt er zo uit te komen.... Indien iemand de procedure succesvol volgt en notities maakt "nu hier drukken dan daar", kan dat handig zijn voor volgende mensen die de procedure willen volgen. Stuur gerust een Email met "het was makkelijk ik hoefde alleen maar .... te doen." of "Het was moeilijk ik moest eerst dit dan dat ... "
Een alternatief is om de dfu-util software te gebruiken zoals onder Linux. [http://dfu-util.sourceforge.net/ De dfu-util homepage] zegt dat er windows binaries zijn. Dat zou, eenmaal geinstalleerd vergelijkbaar moeten werken als de Linux aanwijzingen hierboven.
Het upgraden is vrij "zeker": Het is erg onwaarschijnlijk dat het "werkt" om de oude firmware te wissen, maar niet om de nieuwe te uploaden. Wel zorgen dat het bridgeclock.dfu bestand in de buurt is....
d7aa6409f152b83850ad6ea757dcd34b7407fab2
4274
4273
2018-03-14T12:57:33Z
Rew
3
/* Linux */
wikitext
text/x-wiki
= intro =
De bridgeklok bestaat in twee versies, uiterlijk nauwelijks van mekaar te onderscheiden. Versie 1 is gebaseerd op een atmel AT90USB162. Versie 2 en volgende zijn gebaseerd op een STM32F072. Zorg dat u de juiste instructies opvolgt indien u een upgrade wilt/moet uitvoeren.
== Versie 1 ==
Verwijder de voedingskabel. Sluit de bridgeklok aan op de computer met een USB kabel. Er is nu niet genoeg spanning om de normale segmenten te laten oplichten, maar wel de punten. U zult dus niets in het display zien, maar wel mogelijk een knipperende punt. Dit is normaal.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het verdient aanbeveling om eerst zonder spanning op het apparaat te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Hoe nu verder is nog niet geschreven: Er is nog geen update voor deze versie.
== Versie 2 ==
Verwijder de voedingskabel.
Druk nu op de achterkant op het knopje wat diep achter het linker gaatje in het apparaat zit. Het gaat hier om het gaatje wat een cm of twee linkonder het andere ronde gaatje zit. Het verdient aanbeveling om eerst te zoeken naar een geschikt stuk gereedschap en te voelen of U het knopje kunt vinden. Een sateprikker werkt wel aardig.
Vervolgens, terwijl u het knopje ingedrukt houdt, sluit U de bridgeklok aan op de computer met een USB kabel.
De klok moet zich nu melden als:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(Waar deze informatie bij moderne windows computers verstopt zit weet ik niet. Iemand die het weet mag het even doorgeven, dan zet ik het er hier bij voor de volgende mensen.) Indien U dit niet kunt vinden: geen paniek, als het niet gelukt is merken we het even verderop vanzelf.
Het apparaat moet nu via "Device Firmware Update" (DFU) van nieuwe firmware voorzien worden.
=== Linux ===
U dient het dfu-util programma te installeren. Onder Ubuntu/Debian/Rasbian gaat dat met:
sudo apt-get install dfu-util
Daarna kunt u de nieuwe firmware installeren met:
dfu-util -a 0 -D bridgeclock.dfu
=== MS Windows ===
U kunt de software downloaden van [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll de ST website]. Aldaar op de kleine "get software" knop drukken. Deze software zou nu met het geleverde "bridgeclock.dfu" bestand en de geprepareerde klok overweg moeten kunnen om de boel te upgraden.
Dit is ST software en ST microelectronics zou daar een handleiding van geschreven moeten hebben. Die vind u op de gelinkte webpagina door iets naar boven te scrollen. Met een beetje mazzel valt er zo uit te komen.... Indien iemand de procedure succesvol volgt en notities maakt "nu hier drukken dan daar", kan dat handig zijn voor volgende mensen die de procedure willen volgen. Stuur gerust een Email met "het was makkelijk ik hoefde alleen maar .... te doen." of "Het was moeilijk ik moest eerst dit dan dat ... "
Een alternatief is om de dfu-util software te gebruiken zoals onder Linux. [http://dfu-util.sourceforge.net/ De dfu-util homepage] zegt dat er windows binaries zijn. Dat zou, eenmaal geinstalleerd vergelijkbaar moeten werken als de Linux aanwijzingen hierboven.
Het upgraden is vrij "zeker": Het is erg onwaarschijnlijk dat het "werkt" om de oude firmware te wissen, maar niet om de nieuwe te uploaden. Wel zorgen dat het bridgeclock.dfu bestand in de buurt is....
6fb85b35aab337fe8e2ec8e42f554d320c03bbe4
Brideclock upgrade
0
2011
4280
2018-04-01T21:35:06Z
Rew
3
Created page with "= intro = The bridgeclock (bridgetimer) exists in two versions. They look a lot like eachother. Version 1 was based on an Atmel AT90USB162. Version two and further are based..."
wikitext
text/x-wiki
= intro =
The bridgeclock (bridgetimer) exists in two versions. They look a lot like eachother. Version 1 was based on an Atmel AT90USB162. Version two and further are based on an STM32F072. Make sure to follow the right instructions when you perform an upgrade. (but the upgrade software will not brick the hardware if you do happen to follow the wrong instructions).
== Version 1 ==
Remove the power cable. Connect the clock to a computer with an USB cable. The normal segments now have too low voltage to light up, but the clock will run (and sound the alarm after 10 seconds!). The dots work and will light up normally.
Now press the button that is reachable through the left of the two holes on the back of the device. It is best to practise a bit to find the button without power on the device, especially if you're using something with a metal tip. A wooden toothpic may work nicely.
How to proceed had not been written yet. Finish soon.
=== dfu-programmer ===
Using dfu-programmer the installation instructions depend on linux vs Windows, but the upgrade instructions are essentially the same.
==== Linux ====
On debian-based distributions install dfu-programmer with:
sudo apt-get dfu-programmer
In the following upgrade instructions, consider prefixing the commands with sudo or starting a root shell with
sudo -s
Now continue with the common instructions.
==== Windows ====
Go to [https://dfu-programmer.github.io/ The dfu-programmer home page] and download the windows binaries.
Now continue with the common instructions.
==== Common instructions ====
These three commands in sequence should program your device:
dfu-programmer at90usb162 erase
dfu-programmer at90usb162 --suppress-bootloader-mem bridgeclock.hex
dfu-programmer at90usb162 start
If the first command says: "device not present", it might be that your clock has an atmega16u2. In that case, change the commands to say atmega16u2 where it now says at90usb162. We use these two chips interchangeably: they are close to identical (except for announcing a different name on the USB bus I haven't been able to find a single difference).
=== FLIP ===
Atmel publishes a DFU utility called FLIP. I haven't used it in a decade, but it should be possible to do it with this program. (under Windows).
== Version 2 ==
Remove the power cable.
Now press the button that hides behind the left hole when viewing the device from the rear. The hole is about 2 cm away from the other round hole. It is a good idea to feel around first to try to find the button first and to find a good tool to activate the button without power on the device. A toothpick with a blunted end might work nicely.
Then.... WHILE pressing on the button connect the bridgeclock to the computer. Once connected you may let go of the button.
The clock will then show up on the USB bus as:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(That is from the log on a Linux machine. Where you can find this on a modern Windows machine: I don't know. If you know: send me an email).
If you don't find this: don't worry. If the device thinks you did not press the button, you'll know ten seconds later when it sounds the alarm. And the upgrade won't work.
The device is now in the so-called "Device Firmware Update" (DFU) mode. This allows us to send it new firmware.
=== Linux ===
You need to install the "dfu-util" program. On Ubuntu/Debian/Rasbian that can be done with:
sudo apt-get install dfu-util
Then you can install the new firmware with the command:
dfu-util -a 0 -D bridgeclock.dfu
=== MS Windows ===
==== DfuSe from ST ====
You can download the windows software from [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll the ST website]. There you need to click on the "get software" link. This software should be able to program the device with the "bridgeclock.dfu" file that you got from us.
This software was written by the big company ST microelectronics and they should have a manual for it. You can find it on the page linked above. (If you succesfully follow the procedure you can help others by writing them down and Emailing them to us.)
==== dfu-util ====
Alternatively you can use the open source utility dfu-util like you would under Linux. [http://dfu-util.sourceforge.net/ The dfu-util homepage] says that there are windows binaries. Those should, once installed, work just like under Linux. (i.e. follow the instructions under the Linux header. (not the apt-get but the dfu-util line) )
In any case the upgrade is quite "robust". The software will know when no or a wrong device is present. It will refuse to program the wrong brand firmware into a working clock to render it not-working (bricked is the technical term).
56c263b4dcf858d48cd8d32fe168d1d973467614
4281
4280
2018-04-01T21:57:10Z
Rew
3
/* intro */
wikitext
text/x-wiki
= intro =
The bridgeclock (bridgetimer) exists in two versions. They look a lot like each other. Version 1 was based on an Atmel AT90USB162. Version two and further are based on an STM32F072. Make sure to follow the right instructions when you perform an upgrade. (but the upgrade software will not brick the hardware if you do happen to follow the wrong instructions).
== Version 1 ==
Remove the power cable. Connect the clock to a computer with an USB cable. The normal segments now have too low voltage to light up, but the clock will run (and sound the alarm after 10 seconds!). The dots work and will light up normally.
Now press the button that is reachable through the left of the two holes on the back of the device. It is best to practise a bit to find the button without power on the device, especially if you're using something with a metal tip. A wooden toothpic may work nicely.
How to proceed had not been written yet. Finish soon.
=== dfu-programmer ===
Using dfu-programmer the installation instructions depend on linux vs Windows, but the upgrade instructions are essentially the same.
==== Linux ====
On debian-based distributions install dfu-programmer with:
sudo apt-get dfu-programmer
In the following upgrade instructions, consider prefixing the commands with sudo or starting a root shell with
sudo -s
Now continue with the common instructions.
==== Windows ====
Go to [https://dfu-programmer.github.io/ The dfu-programmer home page] and download the windows binaries.
Now continue with the common instructions.
==== Common instructions ====
These three commands in sequence should program your device:
dfu-programmer at90usb162 erase
dfu-programmer at90usb162 --suppress-bootloader-mem bridgeclock.hex
dfu-programmer at90usb162 start
If the first command says: "device not present", it might be that your clock has an atmega16u2. In that case, change the commands to say atmega16u2 where it now says at90usb162. We use these two chips interchangeably: they are close to identical (except for announcing a different name on the USB bus I haven't been able to find a single difference).
=== FLIP ===
Atmel publishes a DFU utility called FLIP. I haven't used it in a decade, but it should be possible to do it with this program. (under Windows).
== Version 2 ==
Remove the power cable.
Now press the button that hides behind the left hole when viewing the device from the rear. The hole is about 2 cm away from the other round hole. It is a good idea to feel around first to try to find the button first and to find a good tool to activate the button without power on the device. A toothpick with a blunted end might work nicely.
Then.... WHILE pressing on the button connect the bridgeclock to the computer. Once connected you may let go of the button.
The clock will then show up on the USB bus as:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(That is from the log on a Linux machine. Where you can find this on a modern Windows machine: I don't know. If you know: send me an email).
If you don't find this: don't worry. If the device thinks you did not press the button, you'll know ten seconds later when it sounds the alarm. And the upgrade won't work.
The device is now in the so-called "Device Firmware Update" (DFU) mode. This allows us to send it new firmware.
=== Linux ===
You need to install the "dfu-util" program. On Ubuntu/Debian/Rasbian that can be done with:
sudo apt-get install dfu-util
Then you can install the new firmware with the command:
dfu-util -a 0 -D bridgeclock.dfu
=== MS Windows ===
==== DfuSe from ST ====
You can download the windows software from [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll the ST website]. There you need to click on the "get software" link. This software should be able to program the device with the "bridgeclock.dfu" file that you got from us.
This software was written by the big company ST microelectronics and they should have a manual for it. You can find it on the page linked above. (If you succesfully follow the procedure you can help others by writing them down and Emailing them to us.)
==== dfu-util ====
Alternatively you can use the open source utility dfu-util like you would under Linux. [http://dfu-util.sourceforge.net/ The dfu-util homepage] says that there are windows binaries. Those should, once installed, work just like under Linux. (i.e. follow the instructions under the Linux header. (not the apt-get but the dfu-util line) )
In any case the upgrade is quite "robust". The software will know when no or a wrong device is present. It will refuse to program the wrong brand firmware into a working clock to render it not-working (bricked is the technical term).
1cea9736bdde13d6864a7a8fdee8b74f9ff0cd65
4283
4281
2018-04-02T19:30:06Z
Rew
3
/* intro */
wikitext
text/x-wiki
= intro =
The bridgeclock (bridgetimer) exists in two versions. They look a lot like each other. Version 1 was based on an Atmel AT90USB162. Version two and further are based on an STM32F072. Make sure to follow the right instructions when you perform an upgrade. (but the upgrade software will not brick the hardware if you do happen to follow the wrong instructions).
Here is a picture of Version 1. You can recognize Version two because the two circular holes in the back are closer together.
[[File:bridgeclock_AVR.jpg|thumb|300px]]
== Version 1 ==
Remove the power cable. Connect the clock to a computer with an USB cable. The normal segments now have too low voltage to light up, but the clock will run (and sound the alarm after 10 seconds!). The dots work and will light up normally.
Now press the button that is reachable through the left of the two holes on the back of the device. It is best to practise a bit to find the button without power on the device, especially if you're using something with a metal tip. A wooden toothpic may work nicely.
How to proceed had not been written yet. Finish soon.
=== dfu-programmer ===
Using dfu-programmer the installation instructions depend on linux vs Windows, but the upgrade instructions are essentially the same.
==== Linux ====
On debian-based distributions install dfu-programmer with:
sudo apt-get dfu-programmer
In the following upgrade instructions, consider prefixing the commands with sudo or starting a root shell with
sudo -s
Now continue with the common instructions.
==== Windows ====
Go to [https://dfu-programmer.github.io/ The dfu-programmer home page] and download the windows binaries.
Now continue with the common instructions.
==== Common instructions ====
These three commands in sequence should program your device:
dfu-programmer at90usb162 erase
dfu-programmer at90usb162 --suppress-bootloader-mem bridgeclock.hex
dfu-programmer at90usb162 start
If the first command says: "device not present", it might be that your clock has an atmega16u2. In that case, change the commands to say atmega16u2 where it now says at90usb162. We use these two chips interchangeably: they are close to identical (except for announcing a different name on the USB bus I haven't been able to find a single difference).
=== FLIP ===
Atmel publishes a DFU utility called FLIP. I haven't used it in a decade, but it should be possible to do it with this program. (under Windows).
== Version 2 ==
Remove the power cable.
Now press the button that hides behind the left hole when viewing the device from the rear. The hole is about 2 cm away from the other round hole. It is a good idea to feel around first to try to find the button first and to find a good tool to activate the button without power on the device. A toothpick with a blunted end might work nicely.
Then.... WHILE pressing on the button connect the bridgeclock to the computer. Once connected you may let go of the button.
The clock will then show up on the USB bus as:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(That is from the log on a Linux machine. Where you can find this on a modern Windows machine: I don't know. If you know: send me an email).
If you don't find this: don't worry. If the device thinks you did not press the button, you'll know ten seconds later when it sounds the alarm. And the upgrade won't work.
The device is now in the so-called "Device Firmware Update" (DFU) mode. This allows us to send it new firmware.
=== Linux ===
You need to install the "dfu-util" program. On Ubuntu/Debian/Rasbian that can be done with:
sudo apt-get install dfu-util
Then you can install the new firmware with the command:
dfu-util -a 0 -D bridgeclock.dfu
=== MS Windows ===
==== DfuSe from ST ====
You can download the windows software from [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll the ST website]. There you need to click on the "get software" link. This software should be able to program the device with the "bridgeclock.dfu" file that you got from us.
This software was written by the big company ST microelectronics and they should have a manual for it. You can find it on the page linked above. (If you succesfully follow the procedure you can help others by writing them down and Emailing them to us.)
==== dfu-util ====
Alternatively you can use the open source utility dfu-util like you would under Linux. [http://dfu-util.sourceforge.net/ The dfu-util homepage] says that there are windows binaries. Those should, once installed, work just like under Linux. (i.e. follow the instructions under the Linux header. (not the apt-get but the dfu-util line) )
In any case the upgrade is quite "robust". The software will know when no or a wrong device is present. It will refuse to program the wrong brand firmware into a working clock to render it not-working (bricked is the technical term).
3900bfd0034a3e3a2275a1c39b214b72c3a18ca5
4284
4283
2018-04-02T19:31:03Z
Rew
3
/* Version 1 */
wikitext
text/x-wiki
= intro =
The bridgeclock (bridgetimer) exists in two versions. They look a lot like each other. Version 1 was based on an Atmel AT90USB162. Version two and further are based on an STM32F072. Make sure to follow the right instructions when you perform an upgrade. (but the upgrade software will not brick the hardware if you do happen to follow the wrong instructions).
Here is a picture of Version 1. You can recognize Version two because the two circular holes in the back are closer together.
[[File:bridgeclock_AVR.jpg|thumb|300px]]
== Version 1 ==
Remove the power cable. Connect the clock to a computer with an USB cable. The normal segments now have too low voltage to light up, but the clock will run (and sound the alarm after 10 seconds!). The dots work and will light up normally.
Now press the button that is reachable through the left of the two holes on the back of the device. It is best to practise a bit to find the button without power on the device, especially if you're using something with a metal tip. A wooden toothpic may work nicely.
=== dfu-programmer ===
Using dfu-programmer the installation instructions depend on linux vs Windows, but the upgrade instructions are essentially the same.
==== Linux ====
On debian-based distributions install dfu-programmer with:
sudo apt-get dfu-programmer
In the following upgrade instructions, consider prefixing the commands with sudo or starting a root shell with
sudo -s
Now continue with the common instructions.
==== Windows ====
Go to [https://dfu-programmer.github.io/ The dfu-programmer home page] and download the windows binaries.
Now continue with the common instructions.
==== Common instructions ====
These three commands in sequence should program your device:
dfu-programmer at90usb162 erase
dfu-programmer at90usb162 --suppress-bootloader-mem bridgeclock.hex
dfu-programmer at90usb162 start
If the first command says: "device not present", it might be that your clock has an atmega16u2. In that case, change the commands to say atmega16u2 where it now says at90usb162. We use these two chips interchangeably: they are close to identical (except for announcing a different name on the USB bus I haven't been able to find a single difference).
=== FLIP ===
Atmel publishes a DFU utility called FLIP. I haven't used it in a decade, but it should be possible to do it with this program. (under Windows).
== Version 2 ==
Remove the power cable.
Now press the button that hides behind the left hole when viewing the device from the rear. The hole is about 2 cm away from the other round hole. It is a good idea to feel around first to try to find the button first and to find a good tool to activate the button without power on the device. A toothpick with a blunted end might work nicely.
Then.... WHILE pressing on the button connect the bridgeclock to the computer. Once connected you may let go of the button.
The clock will then show up on the USB bus as:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(That is from the log on a Linux machine. Where you can find this on a modern Windows machine: I don't know. If you know: send me an email).
If you don't find this: don't worry. If the device thinks you did not press the button, you'll know ten seconds later when it sounds the alarm. And the upgrade won't work.
The device is now in the so-called "Device Firmware Update" (DFU) mode. This allows us to send it new firmware.
=== Linux ===
You need to install the "dfu-util" program. On Ubuntu/Debian/Rasbian that can be done with:
sudo apt-get install dfu-util
Then you can install the new firmware with the command:
dfu-util -a 0 -D bridgeclock.dfu
=== MS Windows ===
==== DfuSe from ST ====
You can download the windows software from [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll the ST website]. There you need to click on the "get software" link. This software should be able to program the device with the "bridgeclock.dfu" file that you got from us.
This software was written by the big company ST microelectronics and they should have a manual for it. You can find it on the page linked above. (If you succesfully follow the procedure you can help others by writing them down and Emailing them to us.)
==== dfu-util ====
Alternatively you can use the open source utility dfu-util like you would under Linux. [http://dfu-util.sourceforge.net/ The dfu-util homepage] says that there are windows binaries. Those should, once installed, work just like under Linux. (i.e. follow the instructions under the Linux header. (not the apt-get but the dfu-util line) )
In any case the upgrade is quite "robust". The software will know when no or a wrong device is present. It will refuse to program the wrong brand firmware into a working clock to render it not-working (bricked is the technical term).
e73b17725aefd14704d6f936926dd6f64965b788
4285
4284
2018-04-02T19:32:54Z
Rew
3
/* FLIP */
wikitext
text/x-wiki
= intro =
The bridgeclock (bridgetimer) exists in two versions. They look a lot like each other. Version 1 was based on an Atmel AT90USB162. Version two and further are based on an STM32F072. Make sure to follow the right instructions when you perform an upgrade. (but the upgrade software will not brick the hardware if you do happen to follow the wrong instructions).
Here is a picture of Version 1. You can recognize Version two because the two circular holes in the back are closer together.
[[File:bridgeclock_AVR.jpg|thumb|300px]]
== Version 1 ==
Remove the power cable. Connect the clock to a computer with an USB cable. The normal segments now have too low voltage to light up, but the clock will run (and sound the alarm after 10 seconds!). The dots work and will light up normally.
Now press the button that is reachable through the left of the two holes on the back of the device. It is best to practise a bit to find the button without power on the device, especially if you're using something with a metal tip. A wooden toothpic may work nicely.
=== dfu-programmer ===
Using dfu-programmer the installation instructions depend on linux vs Windows, but the upgrade instructions are essentially the same.
==== Linux ====
On debian-based distributions install dfu-programmer with:
sudo apt-get dfu-programmer
In the following upgrade instructions, consider prefixing the commands with sudo or starting a root shell with
sudo -s
Now continue with the common instructions.
==== Windows ====
Go to [https://dfu-programmer.github.io/ The dfu-programmer home page] and download the windows binaries.
Now continue with the common instructions.
==== Common instructions ====
These three commands in sequence should program your device:
dfu-programmer at90usb162 erase
dfu-programmer at90usb162 --suppress-bootloader-mem bridgeclock.hex
dfu-programmer at90usb162 start
If the first command says: "device not present", it might be that your clock has an atmega16u2. In that case, change the commands to say atmega16u2 where it now says at90usb162. We use these two chips interchangeably: they are close to identical (except for announcing a different name on the USB bus I haven't been able to find a single difference).
=== FLIP ===
Atmel publishes a DFU utility called FLIP. I haven't used it in a decade, but it should be possible to do it with this program. (under Windows). You'll need to consult with Atmel documentation. The procedure will be a bit more pointy-clicky than with the DFU-programmer utility. But I can't help you much further than this.
== Version 2 ==
Remove the power cable.
Now press the button that hides behind the left hole when viewing the device from the rear. The hole is about 2 cm away from the other round hole. It is a good idea to feel around first to try to find the button first and to find a good tool to activate the button without power on the device. A toothpick with a blunted end might work nicely.
Then.... WHILE pressing on the button connect the bridgeclock to the computer. Once connected you may let go of the button.
The clock will then show up on the USB bus as:
Mar 14 13:27:17 getafix kernel: [2936963.979066] usb 7-1: Product: STM32 BOOTLOADER
(That is from the log on a Linux machine. Where you can find this on a modern Windows machine: I don't know. If you know: send me an email).
If you don't find this: don't worry. If the device thinks you did not press the button, you'll know ten seconds later when it sounds the alarm. And the upgrade won't work.
The device is now in the so-called "Device Firmware Update" (DFU) mode. This allows us to send it new firmware.
=== Linux ===
You need to install the "dfu-util" program. On Ubuntu/Debian/Rasbian that can be done with:
sudo apt-get install dfu-util
Then you can install the new firmware with the command:
dfu-util -a 0 -D bridgeclock.dfu
=== MS Windows ===
==== DfuSe from ST ====
You can download the windows software from [http://www.st.com/en/development-tools/stsw-stm32080.html#getsoftware-scroll the ST website]. There you need to click on the "get software" link. This software should be able to program the device with the "bridgeclock.dfu" file that you got from us.
This software was written by the big company ST microelectronics and they should have a manual for it. You can find it on the page linked above. (If you succesfully follow the procedure you can help others by writing them down and Emailing them to us.)
==== dfu-util ====
Alternatively you can use the open source utility dfu-util like you would under Linux. [http://dfu-util.sourceforge.net/ The dfu-util homepage] says that there are windows binaries. Those should, once installed, work just like under Linux. (i.e. follow the instructions under the Linux header. (not the apt-get but the dfu-util line) )
In any case the upgrade is quite "robust". The software will know when no or a wrong device is present. It will refuse to program the wrong brand firmware into a working clock to render it not-working (bricked is the technical term).
875f032f7484b7132cf12e447b76804936a5eb8e
File:Bridgeclock AVR.jpg
6
2012
4282
2018-04-02T19:23:48Z
Rew
3
wikitext
text/x-wiki
da39a3ee5e6b4b0d3255bfef95601890afd80709
Usb ws2812
0
1837
4328
4126
2018-05-18T06:44:21Z
Rew
3
/* uid */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Changelog ==
=== 1.0 ===
* Initial public release
48f0022bcf2559abfdf6283f266c7d64243e8055
4329
4328
2018-05-18T06:45:16Z
Rew
3
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the uuniq identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
=== 1.0 ===
* Initial public release
6ed171e9fd9922d4b06a025b48fcd1136554134a
4330
4329
2018-05-18T06:47:01Z
Rew
3
/* uid */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
=== 1.0 ===
* Initial public release
23ff5676a34cbf31a6a47cef850d717c8ba51476
4331
4330
2018-05-18T06:55:17Z
Rew
3
/* Changelog */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
21c4bf91a76c94f565e085d77276776d1285ff9a
Rtc
0
1652
4348
4081
2018-06-01T11:15:08Z
Rew
3
wikitext
text/x-wiki
= Adding the driver =
== new version ==
Go into raspi-config and enable i2c.
Then add:
dtoverlay=i2c-rtc,mcp7941x
to your /boot/config.txt
== old version ==
For historic reasons the old version is still here. Unless you have an old distribution it is recommended you do it the modern way as documented above.
First, the i2c-bcm2708 i2c driver needs to be loaded. As far as I know, in the first few months of the raspberry pi being available, the module was blacklisted and didn't load automatically. Nowadays "raspi-config" will already give you the option to enable the driver.
What "raspi-config" does (but you can also do by hand) is remove the drivers from /etc/modprobe.d/raspi-blacklist.conf .
If the driver isn't loaded on your system start with:
sudo modprobe i2c-bcm2708
Then load the I2C and RTC drivers as root:
sudo -s
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
== Using the clock ==
To write the system time to the RTC (you might need to run this command twice, when you use the RTC for the first time):
hwclock -w
Read out the RTC, and print the date and time to your console:
hwclock
Read out the RTC, and adjust system time:
hwclock -s
To automatically do this on startup, add the following lines to /etc/rc.local
modprobe i2c-dev
modprobe i2c:mcp7941x
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-0/device/new_device # For rev1 RPi
echo mcp7941x 0x6f > /sys/class/i2c-dev/i2c-1/device/new_device # For rev2 RPi
hwclock -s
Source: http://www.element14.com/community/message/63885
c20e1815a5d2cd0f324027b6308a75e73f65b981
Default addresses
0
484
4354
3634
2018-07-05T09:29:06Z
Rew
3
wikitext
text/x-wiki
The BitWizard boards exist in both an SPI as well as an I2C version. Both versions have the same default address.
Especially if you have more than one board of the same type you can change the default address to something else that you like. See the relevant protocol page for info on how to do that.
{| border=1
! Board !! Address
|-
| [[LCD]] || 0x82
|-
| [[DIO]] || 0x84
|-
| [[Servo]] || 0x86
|-
| [[7FETs]] || 0x88
|-
| [[3FETs]] || 0x8A
|-
| [[temp|Temp]] (sometimes called SPI_LM35) || 0x8C
|-
| [[relay|Relay]] || 0x8E
|-
| [[Motor]] || 0x90
|-
| [[User Interface]] || 0x94
|-
| [[7_Segment]]|| 0x96
|-
<!--
| [[SPI_SPI]] || 0x98
|-
-->
| [[Pushbutton]] || 0x9A
|-
| [[Relay|Bigrelay]] || 0x9C
|-
| [[Dimmer]] || 0x9E
<!--
| Thermo || 0xa0
|-
| ... || 0xA2
|-
-->
|-
| [[Raspberry Juice]] || 0xA4
|-
| [[Relay| RPI SPI Relay]] || 0xA6
|-
| [[High side switch| High Side Switch]] || 0xA8
|}
41be6ec085cd53583c8b5f3b77806d6030195522
High side switch
0
2073
4355
2018-07-05T11:16:14Z
Rew
3
Created page with "[[File:hss.jpg|thumb|300px|alt=The High side switch board|The High side switch]] This is the documentation page for the I2C/SPI High Side Switch boards. The high side switch..."
wikitext
text/x-wiki
[[File:hss.jpg|thumb|300px|alt=The High side switch board|The High side switch]]
This is the documentation page for the I2C/SPI High Side Switch boards.
The high side switch board can be bought here in the [http://www.bitwizard.nl/shop/expansion-boards/hss BitWizard Shop].
== Overview ==
The High side switch board allow you to drive four loads from a 12-24V powersupply, that use up to 1.5A. The board has an I2C and an SPI version.
== Assembly instructions ==
None: the board comes fully assembled.
== Protocol ==
To make the HSS PCB do things, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the HSS PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . The default address of the HSS is 0xa8.
For Arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the hss board as well.
== Jumper settings ==
The HSS board has no normal jumpers.
There is a solder jumper that switches the second SPI port from "SPI port" to "ICSP" port for the little CPU on the board. This is used for development.
== Additional Considerations ==
The switching chips on the board, the ISP762T, claim to be able to do "2A". That kind of spec is usually under the condition that you cool the chip very well. This is probably not ideal on our board, so the limit will be a bit lower. The chip is supposed to protect itself when it gets to hot. The chip is supposed to be able to handle a short. Still I'd try to prevent overload and shorts, just on general principle....
Chips like these end up getting warm/hot when you pass a current through. In theory they can get over 100 degrees C before things get problematic. My rule-of-thumb is that if you don't burn your fingers, things are fine. Above that: Be careful.
Note that when you measure the voltage on the output, the (small) leakage current of the device will be sufficient to make the multimeter show a value as opposed to the 0V you might expect.
Note that the device requires > 6V on the power connection to work properly. (there is an undervoltage lockout that kicks in around 5-6V.)
== Default operation ==
By default the switches will start out in the "off" position. (i.e. the devices connected to the switches are not powered).
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
For the I2C connector see: [[I2C_connector_pinout]].
{| border=1
! pin !! function !! remark
|-
| 1 || GND || GROUND for the power-side.
|-
| 2 || OUT 1 || Switched output 1
|-
| 3 || OUT 1 || Switched output 2
|-
| 4 || OUT 1 || Switched output 3
|-
| 5 || OUT 1 || Switched output 4
|-
| 6 || V+ || positive of the powersupply.
|-
|}
== Controlling the outputs of the HSS board ==
With the 10 register you can turn everything on or off. It is a bitmask register. (bw_tool uses hexadecimal numbers, so add the values for the diffrent relays together, 1,2,4,8 for outputs 1-4.)
bw_tool -s 50000 -a 9c -W 10:0:b #Everything off
bw_tool -s 50000 -a 9c -W 10:1:b #output 1 on
bw_tool -s 50000 -a 9c -W 10:8:b #output 4 on
bw_tool -s 50000 -a 9c -W 10:6:b #output 2 and 3 on
You can use register 20 to 23 to turn every single output on or off.
bw_tool -s 50000 -a 9c -W 20:0:b #output 1 off
bw_tool -s 50000 -a 9c -W 23:1:b #output 4 on
Which method you use is up to you. If your program "knows" the state of all the outputs, using register 0x10 may be easier. But if say you have one program controlling one output and another program controlling another, using the 20-23 registers is probably easier.
== LEDs ==
There is one power led.
== Related projects ==
* [[DIO]]
== External resources ==
=== Datasheets ===
* [[https://www.mouser.com/ds/2/196/Infineon-ISP762T_20121201-DS-v01_04-en-1226583.pdf ISP762T datasheet]]
== Additional software ==
[[bw_tool]]
== TODO ==
* next version will have leds indicating the state of the outputs.
== Changelog ==
=== 1.0 ===
* Initial public release
47b22efd0e04a3fba011414d488d87a35ffd80ef
Orange pi DMX 4x
0
2175
4486
2019-01-16T16:38:18Z
Rew
3
Created page with "== Introduction == The Orange Pi DMX 4x board allows you to interface an Orange pi with DMX hardware. (the Orange pi one I believe. Let me know if you know for sure, or if..."
wikitext
text/x-wiki
== Introduction ==
The Orange Pi DMX 4x board allows you to interface an Orange pi with DMX hardware.
(the Orange pi one I believe. Let me know if you know for sure, or if you've tried other boards)
The CPU on the orange pi has four UARTs so the board supports 4 DMX channels. In theory they can all support DMX out, RDM and DMX in, but in practice, software support for IN is limited.
== Software ==
You can probably run OLA and QLC+ with this card. Currently untested. Let me know if you try it.
The board was designed in cooperation with Arjan van Vught. His suite completely supports this board.
== Hardware ==
Also known as "what's what".
=== gpio ===
First there is the main 40-pin GPIO connector. It should mate with the GPIO connector of your SBC. Please keep an eye on the orientation of the connector. On our board the silkscreen signifies pin 1 with the one corner that is SQUARE, all other three are chamfered.
On the orange pi this should make the board align mostly with the orange pi. If you have another SBC, you're welcome to try, but for example the raspberry pi has that GPIO connector precisely reversed compared to the orange pi. Thus the board will stick out from the pi. The raspberry pi has only one UART (on the GPIO connector), so it is guaranteed that you'll get only one channel to work.
=== power: Screw ===
There is a power connector with screw terminals.
If you look the connector "in the eye", the left one is the +5V, the other one is GND.
=== power: USB ===
There is an USB connector that would allow you to power the board with underlying pi. Currently: No warranty on this: If it works, it works, if it doesn't it doesn't. Sorry. Plenty of other power options.
=== I2C ===
The I2C bus is exported on this four-pin connector. This bus is not levelshifted as on some of our other boards. 3.3V devices only.
Pinout: GND-SDA-SCL-5V
=== UART4 ===
The GPIO header on the orange pi only has 3 out of the four UARTs. The fourth is labeled "debug UART" and a three pin connector as well. You should've gotten a 3-pin cable to connect the two.
pinout: GND RX TX.
=== jumper blocks ===
Each of the channels has a jumper block.
1-2 enables a pullup of one of the data lines.
3-4 enables termination of the data lines
5-6 enables a pulldown of the other data line.
Some people report bad results when you enable the pullup/pulldown. So be aware.
61f5d7f38feded8e424505dc7a434b96738c8e97
4487
4486
2019-01-23T15:00:15Z
Rew
3
/* Hardware */
wikitext
text/x-wiki
== Introduction ==
The Orange Pi DMX 4x board allows you to interface an Orange pi with DMX hardware.
(the Orange pi one I believe. Let me know if you know for sure, or if you've tried other boards)
The CPU on the orange pi has four UARTs so the board supports 4 DMX channels. In theory they can all support DMX out, RDM and DMX in, but in practice, software support for IN is limited.
== Software ==
You can probably run OLA and QLC+ with this card. Currently untested. Let me know if you try it.
The board was designed in cooperation with Arjan van Vught. His suite completely supports this board.
== flash ==
The board has a 4Mbyte flash chip mounted. You can program Arjan's software in this flash chip and then the orange pi will boot from this flash chip! This eliminates the need for a permanent SD card in the setup.
If you want to run full Linux this flash chip is too small. Maybe it's possible to put the kernel into the flash chip and from then run diskless/NFS-root. This can save a lot of money if you run bunch of these modules and have the network and server available anyway.
== Hardware ==
Also known as "what's what".
=== gpio ===
First there is the main 40-pin GPIO connector. It should mate with the GPIO connector of your SBC. Please keep an eye on the orientation of the connector. On our board the silkscreen signifies pin 1 with the one corner that is SQUARE, all other three are chamfered.
On the orange pi this should make the board align mostly with the orange pi. If you have another SBC, you're welcome to try, but for example the raspberry pi has that GPIO connector precisely reversed compared to the orange pi. Thus the board will stick out from the pi. The raspberry pi has only one UART (on the GPIO connector), so it is guaranteed that you'll get only one channel to work.
=== power: Screw ===
There is a power connector with screw terminals.
If you look the connector "in the eye", the left one is the +5V, the other one is GND.
=== power: USB ===
There is an USB connector that would allow you to power the board with underlying pi. Currently: No warranty on this: If it works, it works, if it doesn't it doesn't. Sorry. Plenty of other power options.
=== I2C ===
The I2C bus is exported on this four-pin connector. This bus is not levelshifted as on some of our other boards. 3.3V devices only.
Pinout: GND-SDA-SCL-5V
=== UART4 ===
The GPIO header on the orange pi only has 3 out of the four UARTs. The fourth is labeled "debug UART" and a three pin connector as well. You should've gotten a 3-pin cable to connect the two.
pinout: GND RX TX.
=== jumper blocks ===
Each of the channels has a jumper block.
1-2 enables a pullup of one of the data lines.
3-4 enables termination of the data lines
5-6 enables a pulldown of the other data line.
Some people report bad results when you enable the pullup/pulldown. So be aware.
9eebbe9ea8299f8f74e5a77b600bc6132721d32e
Talk:Besc
1
2182
4494
2019-02-07T09:12:01Z
Joedev
3560
Request for addition of available pictures
wikitext
text/x-wiki
== Pictures of fully assembled boards ==
As companion to the written instructions, it could be helpful to have a few pictures of assembled systems, clearly showing wiring connections and notes on modifications if any.
[[User:Joedev|Joedev]] ([[User talk:Joedev|talk]]) 10:12, 7 February 2019 (CET)
148a92834e2305a9dc0ce254a7a8a06b0a3b6e11
4495
4494
2019-02-16T11:20:03Z
Rew
3
/* Pictures of fully assembled boards */
wikitext
text/x-wiki
== Pictures of fully assembled boards ==
As companion to the written instructions, it could be helpful to have a few pictures of assembled systems, clearly showing wiring connections and notes on modifications if any.
[[User:Joedev|Joedev]] ([[User talk:Joedev|talk]]) 10:12, 7 February 2019 (CET)
workaround.
42cabddea12cfaa46f59e6cef5dd67af8a407174
Talk:Dmx interface for raspberry pi
1
2188
4501
2019-03-11T16:00:32Z
0mn1p0tent
3574
Consider reorganizing the OLA section of the WIKI for clarity.
wikitext
text/x-wiki
Reorganize the OLA section so it doesn't list pre-req instructions AFTER the OLA installation.
General instructions [common to all]: ALL Raspberries MUST do this.
-=THEN=-
More specific hardware: raspberry pi 3 [YES/NO]: If I do not have a pi 3 I can just skip and move to the next section.
-=THEN=-
Even more Specific: stretch, jessie, wheezy (choose the version installed and only read/follow the instructions which apply to me)
2.1.2 OLA
2.1.2.1 all raspberries
2.1.2.2 raspberry pi 3
2.1.2.3 output mode
2.1.2.4 stretch
2.1.2.5 Jessie
2.1.2.6 wheezy
I spent a lot of time unsuccessfully trying to get my hardware/software to work properly.
I scrapped everything then performed the steps in this sequence and I succeeded.
90c4a33c788f40592911e6f5582b50749d08e121
Thermocouple
0
1821
4510
3475
2019-05-10T10:38:26Z
Rew
3
/* Specifications */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The Thermocouple has a low voltage of 75mV. The low voltage is temperature sensitive, so that makes it possible to read the temperature with it.
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! thermo
|-
| 0x00 || T4
|-
| 0x01 || T3
|-
| 0x02 || T2
|-
| 0x03 || T1
|-
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
More info you can read at [[analog inputs]].
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering Thermocouple ==
Although some BitWizard boards will work with 3.3V as the power supply, the Thermocouple board needs to be supplied with 5V as this voltage is used to drive.
== Protocol ==
To make the Thermocouple be useful, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the Thermocouple PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the Thermocouple board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and Thermocouple boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
fda6d0556eff043cd436954206190670f0316700
4511
4510
2019-05-10T10:38:51Z
Rew
3
/* Overview */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The Thermocouple has a low voltage of max about 75mV. The low voltage is temperature sensitive, so that makes it possible to read the temperature with it.
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! thermo
|-
| 0x00 || T4
|-
| 0x01 || T3
|-
| 0x02 || T2
|-
| 0x03 || T1
|-
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
More info you can read at [[analog inputs]].
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering Thermocouple ==
Although some BitWizard boards will work with 3.3V as the power supply, the Thermocouple board needs to be supplied with 5V as this voltage is used to drive.
== Protocol ==
To make the Thermocouple be useful, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the Thermocouple PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] . Where the SPI_DIO drives an output high, the Thermocouple board will drive the output pin LOW when the pin is driven active.
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and Thermocouple boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
d7d7925bea8f0599c7fc7ad5a7acfe4c1a30341d
Thermocouple
0
1821
4512
4511
2019-05-10T10:40:09Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:Thermocouple.jpg|thumb|300px|The Thermocouple (I2C version)]]
This is the documentation page for the Thermocouple, that you can buy in the [http://www.bitwizard.nl/shop/expansion-boards/thermocouple BitWizard shop].
== Overview ==
The Thermocouple has a low voltage of max about 75mV. The low voltage is temperature sensitive, so that makes it possible to read the temperature with it.
The board has 4 pins, which can be changed to input or output.
== Assembly instructions ==
None: the board comes fully assembled.
=== Possible Configurations ===
== External resources ==
=== Datasheets ===
== Additional software ==
=== Related projects ===
== Pinout ==
For the SPI connector see: [[SPI_connector_pinout]].
Normal measurements would return a value of 0 for 0V up to 1023 for the reference value.
{| border=1
! value !! thermo
|-
| 0x00 || T4
|-
| 0x01 || T3
|-
| 0x02 || T2
|-
| 0x03 || T1
|-
|}
The jumper has: 1: GND, 2: DEV POWER, 3: 5V (from SPI).
Put the jumper on 2-3 to use the SPI power (from the arduino? i.e. from USB? -> max at most 400 mA!)
Use a connector on 1-2 to provide a more powerful power source for the devices that the board drives.
More info you can read at [[analog inputs]].
=== LEDs ===
== Power connector ==
The connector SV2 allows you to connect the "power source".
(*) The datasheet for the used transistors mentions "20V", but is is always prudent to keep some margin.
If you want 5V as the power source, you could put a jumper on pin 2-3. In that case you will have to be aware that you're using the 5V power from the rest of the system. This will be limited by e.g. USB power limits, other devices on the SPI bus, cable thickness and connector capability. But for low-current 5V applications this might be useful.
== Jumper settings ==
See [[solder jumpers]] on how to change the solder jumper.
By changing the solder jumper SJ1, you can make the connector nearest the board edge into the ICSP programming connector for the attiny44 on the board.
== Powering Thermocouple ==
Although some BitWizard boards will work with 3.3V as the power supply, the Thermocouple board needs to be supplied with 5V as this voltage is used to drive.
== Protocol ==
To make the Thermocouple be useful, you need to send things over the SPI or I2C bus to the PCB.
The general overview of the protocol is [[General_SPI_protocol|here]].
The specific commands for the Thermocouple PCB are explained on the page about the spi_dio board, as the two boards share the same protocol: [[DIO_protocol]] .
For arduino, a sample PDE is available, called ardemo_lcd.pde, also at [http://www.bitwizard.nl/software the BitWizard software download directory] .
This is a demo to send things using SPI to the lcd board. The SPI routines there are applicable for the dio and Thermocouple boards as well.
== The software ==
== Default operation ==
== Future hardware enhancements ==
== Future software enhancements ==
== Useful links ==
[http://www.bitwizard.nl/shop/expansion-boards/thermocouple The Thermocouple BitWizard shop page]<br>
[[Analog inputs]]<br>
[[DIO protocol]]<br>
[[SPI connector pinout]]
9a376427a5dbf01d4085e5df1779d82a0f988e98
FT4222h
0
1756
4626
4128
2019-11-14T08:47:05Z
Rew
3
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board. That you can buy in the [http://www.bitwizard.nl/shop/breakout-boards?product_id=150 BitWizard shop].
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
As you might expect, the two SPI connectors share the SCK, MISO and MOSI signals to the FT4222H. The slave select on the two SPI connectors route to "SSO0" and "SS"
On the I2C connector you can find the I2C signals SDA (pin 2) and SCL (pin 3) as well as GND (pin 1) and VCC (pin 4). There is no pullup on the i2c lines on the board. You have to provide that externally.
The power (VCC pin) on the I2C and SPI connectors can be jumper selected between 5V and 3V3. The 5V comes from the USB connection. It should be assumed to be limted to 500mA, whereas the 3.3V comes from the FT4222H itself. The datasheet does not specify how much current can be drawn. If you use this to power "slave" circuits, you must verify that you're not drawing too much yourself. (Keep in mind that the 3.3V regulator inside the FT4222H is meant to power just the FT4222H. FTDI often specifies "not for external use" or "max 10mA", but I could not find that in THIS datasheet).
The 14 pin connector at the top has the following pinout:
* 1 - GND
* 2 - GND
* 3 - SCL
* 4 - SDA
* 5 - GPIO2
* 6 - GPIO3
* 7 - MOSI
* 8 - MISO
* 9 - IO2
* 10 - IO3
* 11 - SCK
* 12 - SS0O
* 13 - +3.3V
* 14 - +5V.
On the SPI and I2C connectors there is a pin called "VCC". The voltage is selectable between 5V and 3.3V. Note that even if you
select 5V, the io signals still go directly into the chip which is meant to work with 3.3V voltage levels. (the chip could also work with 1.8 or 2.5V IO signal levels, but on this board it is not configured like that).
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors.
In the picture here, the jumper to select between 3.3V and 5V is still a solder jumper. I've since found that I change such more often than is practical with a solder jumper, so I've decided to change it to a real jumper. When the jumper is 1-2, near the edge of the PCB, the VCC is configured 3.3V, and when the jumper is 2-3, near the middle of the PCB VCC is configured for 5V (from USB).
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
{| class="wikitable"
|-
! DCNF1
! DCNF0
! mode
! num interfaces
|-
| 0
| 0
| mode 0
| 2
|-
| 0
| 0
| mode 1
| 4
|-
| 0
| 0
| mode 2
| 4
|-
| 0
| 0
| mode 3
| 1
|}
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
d744cfb13266a6c717963ea503fa778569672041
4627
4626
2019-11-14T08:53:03Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board. That you can buy in the [http://www.bitwizard.nl/shop/breakout-boards?product_id=150 BitWizard shop].
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
As you might expect, the two SPI connectors share the SCK, MISO and MOSI signals to the FT4222H. The slave select on the two SPI connectors route to "SSO0" and "SS"
On the I2C connector you can find the I2C signals SDA (pin 2) and SCL (pin 3) as well as GND (pin 1) and VCC (pin 4). There is no pullup on the i2c lines on the board. You have to provide that externally.
The power (VCC pin) on the I2C and SPI connectors can be jumper selected between 5V and 3V3. The 5V comes from the USB connection. It should be assumed to be limted to 500mA, whereas the 3.3V comes from the FT4222H itself. The datasheet does not specify how much current can be drawn. If you use this to power "slave" circuits, you must verify that you're not drawing too much yourself. (Keep in mind that the 3.3V regulator inside the FT4222H is meant to power just the FT4222H. FTDI often specifies "not for external use" or "max 10mA", but I could not find that in THIS datasheet).
The 14 pin connector at the top has the following pinout:
* 1 - GND
* 2 - GND
* 3 - SCL
* 4 - SDA
* 5 - GPIO2
* 6 - GPIO3
* 7 - MOSI
* 8 - MISO
* 9 - IO2
* 10 - IO3
* 11 - SCK
* 12 - SS0O
* 13 - +3.3V
* 14 - +5V.
On the SPI and I2C connectors there is a pin called "VCC". The voltage is selectable between 5V and 3.3V. Note that even if you
select 5V, the io signals still go directly into the chip which is meant to work with 3.3V voltage levels. (the chip could also work with 1.8 or 2.5V IO signal levels, but on this board it is not configured like that).
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors.
In the picture here, the jumper to select between 3.3V and 5V is still a solder jumper. I've since found that I change such more often than is practical with a solder jumper, so I've decided to change it to a real jumper. When the jumper is 1-2, near the edge of the PCB, the VCC is configured 3.3V, and when the jumper is 2-3, near the middle of the PCB VCC is configured for 5V (from USB).
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
{| class="wikitable"
|-
! DCNF1
! DCNF0
! mode
! num interfaces
|-
| 0
| 0
| mode 0
| 2
|-
| 0
| 0
| mode 1
| 4
|-
| 0
| 0
| mode 2
| 4
|-
| 0
| 0
| mode 3
| 1
|}
please refer to FTDI documentation about the available option in each of the modes.
== Usage ==
To use the board/chip, you can download the FT4222H library from FTDI's product page. It is available for Linux, Windows and Mac.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
ccc2c7ed1225087a9784e3fa5137811132c3fa99
4632
4627
2020-11-17T19:12:31Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
[[File:FT4222h.jpg|thumb|300px]]
This is the documentation page for the FT4222h breakout board. That you can buy in the [http://www.bitwizard.nl/shop/breakout-boards?product_id=150 BitWizard shop].
== overview ==
The FT4222h breakout board has an USB connector, two SPI connectors, one I2C connector one CNF connector and one 14-pin IO connector. The brains of the PCB, of course, is an FT4222h chip.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT4222h.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT4222h.html FTDI product page]
== pinout ==
See [[SPI connector pinout]] for the pinout of the SPI connectors.
As you might expect, the two SPI connectors share the SCK, MISO and MOSI signals to the FT4222H. The slave select on the two SPI connectors route to "SSO0" and "SS"
On the I2C connector you can find the I2C signals SDA (pin 2) and SCL (pin 3) as well as GND (pin 1) and VCC (pin 4). There is no pullup on the i2c lines on the board. You have to provide that externally.
The power (VCC pin) on the I2C and SPI connectors can be jumper selected between 5V and 3V3. The 5V comes from the USB connection. It should be assumed to be limted to 500mA, whereas the 3.3V comes from the FT4222H itself. The datasheet does not specify how much current can be drawn. If you use this to power "slave" circuits, you must verify that you're not drawing too much yourself. (Keep in mind that the 3.3V regulator inside the FT4222H is meant to power just the FT4222H. FTDI often specifies "not for external use" or "max 10mA", but I could not find that in THIS datasheet).
The 14 pin connector at the top has the following pinout:
* 1 - GND
* 2 - GND
* 3 - SCL
* 4 - SDA
* 5 - GPIO2
* 6 - GPIO3
* 7 - MOSI
* 8 - MISO
* 9 - IO2
* 10 - IO3
* 11 - SCK
* 12 - SS0O
* 13 - +3.3V
* 14 - +5V.
On the SPI and I2C connectors there is a pin called "VCC". The voltage is selectable between 5V and 3.3V. Note that even if you
select 5V, the io signals still go directly into the chip which is meant to work with 3.3V voltage levels. (the chip could also work with 1.8 or 2.5V IO signal levels, but on this board it is not configured like that).
== LEDS ==
* The only LED is a power LED
== Jumper settings ==
The FT4222H chip provides a low-power 3.3V output voltage. You can chose to provide that 3.3V or the 5V from the USB on the SPI and I2C connectors.
In the picture here, the jumper to select between 3.3V and 5V is still a solder jumper. I've since found that I change such more often than is practical with a solder jumper, so I've decided to change it to a real jumper. When the jumper is 1-2, near the edge of the PCB, the VCC is configured 3.3V, and when the jumper is 2-3, near the middle of the PCB VCC is configured for 5V (from USB).
The CNF jumpers allow you to configure the DNCFx signals on the FT4222H. Put the jumper near you (if the USB is on the left) for a 0 and away from you for a 1.
DCNF1 is on the left, DCNF0 is on the right.
{| class="wikitable"
|-
! DCNF1
! DCNF0
! mode
! num interfaces
|-
| 0
| 0
| mode 0
| 2
|-
| 0
| 1
| mode 1
| 4
|-
| 1
| 0
| mode 2
| 4
|-
| 1
| 1
| mode 3
| 1
|}
please refer to FTDI documentation about the available option in each of the modes.
== Usage ==
To use the board/chip, you can download the FT4222H library from FTDI's product page. It is available for Linux, Windows and Mac.
== future hardware enhancements ==
== Changelog ==
1.1
* Initial public release
b3ae0a24412ab1c00831790a78b17ddae57c525e
Usb dmx
0
2189
4628
2019-12-23T16:20:35Z
Rew
3
Created page with "= Introduction = The BitWizard usb-dmx board allows you to control DMX devices from your computer while connecting through USB. There are also the [https://www.bitwizard.nl..."
wikitext
text/x-wiki
= Introduction =
The BitWizard usb-dmx board allows you to control DMX devices from your computer while connecting through USB.
There are also the [https://www.bitwizard.nl/wiki/Dmx_interface_for_raspberry_pi DMX boards for raspberry pi] that mount on top of a raspberry pi. Those use the UART on the raspberry pi, which has the disadvantage that the "input" driver is difficult.
= Software =
When you connect your usb-dmx board, the board will enumerate a virutal serial port.
You can use any terminal program to connect and send commands. The baud rate is ignored (for physical serial ports you need a baud rate, not for virtual ones).
The device should in the future also be able to interpret "enttec USB PRO" commands, but as of this moment this support is unfinished.
== serial commands ==
Some commands are "debug" for development and are not described here.
=== help ===
You can get an overview of commands by issuing the '''help''' command. The commands and a short help message will be displayed.
=== dmx ===
set the DMX data. Give it a start position in the universe and then the data.
example:
dmx 8 7 6 5 4 3 2 1
set the dmx data starting at position 8 to 7,6,5... (ending with 1 in position 14).
=== update ===
Update multiple positions in the DMX universe.
Example:
update 5:6 10-20:200
set position 5 in the universe to 6 and then locations 10-20 all to 200.
=== uid ===
Print the unique id of this board.
=== range ===
superceded by update.
=== fade ===
The fade command allows you to tell the board to handle a fade internally.
fade dump
dumps the current state of the fade system.
fade cancel <num>
cancels a specific fade.
fade clear
clears all current fades.
fade <position>:<target>:<nframes>:<nrep>
will fade the DMX value at position to the target value in nframes steps, repeating this fade nrep times.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
The case for this board has not been designed, but we'll make one if there is demand. Let us know.
fa030bef917a2ba156fadbf9877045ec9745fb11
4629
4628
2019-12-23T16:21:06Z
Rew
3
/* Software */
wikitext
text/x-wiki
= Introduction =
The BitWizard usb-dmx board allows you to control DMX devices from your computer while connecting through USB.
There are also the [https://www.bitwizard.nl/wiki/Dmx_interface_for_raspberry_pi DMX boards for raspberry pi] that mount on top of a raspberry pi. Those use the UART on the raspberry pi, which has the disadvantage that the "input" driver is difficult.
= Software =
When you connect your usb-dmx board, the board will enumerate a virutal serial port.
You can use any terminal program to connect and send commands. The baud rate is ignored (for physical serial ports you need a baud rate, not for virtual ones).
The device should in the future also be able to interpret "enttec USB PRO" commands, but as of this moment this support is unfinished.
== serial commands ==
Some commands are "debug" for development and are not described here.
=== help ===
You can get an overview of commands by issuing the '''help''' command. The commands and a short help message will be displayed.
=== dmx ===
set the DMX data. Give it a start position in the universe and then the data.
example:
dmx 8 7 6 5 4 3 2 1
set the dmx data starting at position 8 to 7,6,5... (ending with 1 in position 14).
=== update ===
Update multiple positions in the DMX universe.
Example:
update 5:6 10-20:200
set position 5 in the universe to 6 and then locations 10-20 all to 200.
=== uid ===
Print the unique id of this board.
=== range ===
superceded by update.
=== fade ===
The fade command allows you to tell the board to handle a fade internally.
fade dump
dumps the current state of the fade system.
fade cancel <num>
cancels a specific fade.
fade clear
clears all current fades.
fade <position>:<target>:<nframes>:<nrep>
will fade the DMX value at position to the target value in nframes steps, repeating this fade nrep times.
= jumper settings =
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
= Case =
The case for this board has not been designed, but we'll make one if there is demand. Let us know.
c952f83dbf6f226315888b96ec09229f176a3793
Dmx interface for raspberry pi
0
1968
4630
4505
2020-04-04T13:37:11Z
Rew
3
/* output mode */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
Add:
dtoverlay=pi3-disable-bt
to your config.txt file in the /boot directory.
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
dddc7a99b1b37a6cc52ab7a3eb859cdde5ac2d16
4648
4630
2021-05-12T08:04:37Z
Rew
3
/* raspberry pi 3 */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 ====
It seems this was changed. The new line needs to be:
dtoverlay=disable-bt
that needs to be added to /boot/config.txt.
It used to be:
dtoverlay=pi3-disable-bt
(For reference in case you have an older installation.)
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
99909f1479419c434d19f619f42d1c49f647ba05
4649
4648
2021-06-11T12:24:16Z
Rew
3
/* raspberry pi 3 */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
It seems this was changed. The new line needs to be:
dtoverlay=disable-bt
that needs to be added to /boot/config.txt.
It used to be:
dtoverlay=pi3-disable-bt
(For reference in case you have an older installation.)
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
f99ed90edaccf379dae56cc5f2be2fd3dc8696b6
4650
4649
2021-06-11T12:42:37Z
Rew
3
/* raspberry pi 3 and pi 4 */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
6f69526846f845b36610fb6529eaf54027a9877c
4671
4650
2023-09-20T18:41:15Z
Rew
3
/* raspberry pi 3 and pi 4 */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory.
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
c336f24973acf39c1820fe61bfb0a844ef580d28
4672
4671
2023-09-20T18:43:08Z
Rew
3
/* all raspberries */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (IIRC there is an "exit 0" in there, so don't put it AFTER that!)
Or you can install the gpio utility from wiringpi and use the following command to view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
6117c71cb36c1725a6c5b9daa74a75dca74926ab
4673
4672
2023-09-20T18:49:21Z
Rew
3
/* output mode */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
f6192c97e815a3e6017999ab2404ee8113ad5279
4674
4673
2023-09-20T19:09:41Z
Rew
3
/* OLA */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== bullseye ====
It seems that once again the stock OLA distribution has a problem with the uartdmx plugin.
To compile ola from scratch from the github current version first install the dependencies:
sudo apt build-dep ola
then get the sources:
git clone https://github.com/OpenLightingProject/ola.git
Then configure, build and install:
cd ola
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
next I had to add the olad user to the group tty to allow it to write to the device:
sudo adduser olad tty
FYI: A non-working olad will report
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
while a working one will report:
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
Also FYI: I've compared the sources for the "working" distro-ola and the working-from-git and the only changes are documentation-related. Not a single line-of-code was changed between the two versions.
If I've missed a step when you try this, let me know. (also let me know if all this was not necessary on your system, and say your distribution's ola worked).
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
381b12aff6eb1b599a03a5ed501fc7221bf6eb12
I2C splitter
0
1683
4631
3566
2020-09-22T08:43:16Z
Rew
3
wikitext
text/x-wiki
The I2C splitter can be bought in the [https://bitwizard.nl/shop/I2C-Splitter-Switch-with-PCA9548A-TCA9548A BitWizard shop].
= General info =
Based on the PCA9548A chip from NXP<br>
http://www.nxp.com/documents/data_sheet/PCA9548A.pdf <br>
<br>
I2C address:<br>
1110 000 tru 1110 111 (jumper selectable)<br>
<br>
Each I2C output has 4K7 pull-up resistors.
The address would be written "0x70" for the Linux I2C-tools. BitWizard "naming convention" would call this address "0xe0".
= Physical dimensions =
* Board outline: 50x25mm
* Mounting hole diameter: 3mm
* Mounting hole pitch: 44x19mm (3mm from board edge)
= Pinouts =
Hold the board such that the 4x8 pin array is on the left.
The 4x8 array has from left to right, GND (labeled "V-" because "GND" didn't fit), SDA (labeled DA), SCL (CL), and VCC (V+).
From top to bottom you will find bus 0 at the top to bus 7 at the bottom.
Connect your "master device" to the connector on the left or right. The pinout is GND, SDA, SCL, VCC from bottom to top.
[[File:Dsc05850_edit.jpg|thumb|500px|alt=The annotated i2c_splitter board|The i2c_splitter board]]
The "Vout" connector provides GND/AUX/VCC. By placing a jumper on AUX/VCC, you can configure your slave I2C busses to use the same power supply as your main VCC (usually 5V or 3.3V). If you require a different voltage, you can apply that voltage using a two-pin connector using GND/AUX on the same connector. If you ordered the special version prepared for a specific output voltage, no connection/jumper is necessary on the VOUT connector. You can measure the output voltage on the AUX pin if you want (there are 8 other pins that make this voltage available, but it's there. :-) )
= Jumpers =
== Address jumpers ==
It is recommended you use address 0 for the PCA9548A, unless that clashes with something on your I2C bus. Put all three jumpers to the position nearest you, in the position marked "0".
== Power jumper/power connector ==
If your board has a jumper labeled "VOUT" near the bottom, this can be used to select the voltage level on the output bus. Connect a jumper on the rightmost two pins (AUX/VCC) to use the power from the "master" connector on the left or right of the PCB. If that is undesired, for example if your master is 5V and your slave devices are 3.3V, you can connect a 3.3V power source to the ground pin on the left and the VAUX pin in the middle.
= Using the board =
On the raspberry pi, the board can be controlled with i2cset:
i2cset -y 0 0x70 0x01
to for example select the first bus.
bb131391532dce39ee8bd2cc4af7fa1eb445367d
Servo 1.0 protocol
0
126
4633
3711
2020-11-22T13:43:34Z
Rew
3
/* Read identification */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
605a99d04db167f86b0e3e8ff03270230ca1bfb0
4634
4633
2020-11-22T13:52:15Z
Rew
3
/* Write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0x50 || set servo values as an array. Write 1-7 servo position bytes (always starting at servo 0) in one transaction.
|-
| 0x51 || set servo values as an array. Write 1-7 servo timing values (16 bits/servo) in one transaction.
|-
| 0x58 || 8bit servo positions are converted to 16 bit timing values using tv = base + pos*mul; default base = 988 giving the normal 1000-2000 microsecond timing value range. This register is 16 bits and modifies the base.
|-
| 0x59 || this changes the multiplication factor. See 0x58.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
8ecc25703b10babbb8d08be31a4827f20634be07
4635
4634
2020-11-22T13:53:07Z
Rew
3
/* Write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0x50 || (#) set servo values as an array. Write 1-7 servo position bytes (always starting at servo 0) in one transaction.
|-
| 0x51 || (#) set servo values as an array. Write 1-7 servo timing values (16 bits/servo) in one transaction.
|-
| 0x58 || (#) 8bit servo positions are converted to 16 bit timing values using tv = base + pos*mul; default base = 988 giving the normal 1000-2000 microsecond timing value range. This register is 16 bits and modifies the base.
|-
| 0x59 || (#) this changes the multiplication factor. See 0x58.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
(#) From version 2.1 and up. (0x50 from 2.0)
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
cbdb885bf13819fd03f90b1f8ee4fabad240a7bc
4636
4635
2020-11-22T13:53:18Z
Rew
3
/* Write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 position in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0x50 || (#) set servo values as an array. Write 1-7 servo position bytes (always starting at servo 0) in one transaction.
|-
| 0x51 || (#) set servo values as an array. Write 1-7 servo timing values (16 bits/servo) in one transaction.
|-
| 0x58 || (#) 8bit servo positions are converted to 16 bit timing values using tv = base + pos*mul; default base = 988 giving the normal 1000-2000 microsecond timing value range. This register is 16 bits and modifies the base.
|-
| 0x59 || (#) this changes the multiplication factor. See 0x58.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
(#) From version 2.1 and up. (0x50 from 2.0)
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
c0c0a81fe52af193934bf512c467aff748d1436a
4637
4636
2020-11-22T13:54:04Z
Rew
3
/* Write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 timing in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0x50 || (#) set servo values as an array. Write 1-7 servo position bytes (always starting at servo 0) in one transaction.
|-
| 0x51 || (#) set servo values as an array. Write 1-7 servo timing values (16 bits/servo) in one transaction.
|-
| 0x58 || (#) 8bit servo positions are converted to 16 bit timing values using tv = base + pos*mul; default base = 988 giving the normal 1000-2000 microsecond timing value range. This register is 16 bits and modifies the base.
|-
| 0x59 || (#) this changes the multiplication factor. See 0x58.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
(#) From version 2.1 and up. (0x50 from 2.0)
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
99301c709f03e3517d2cc15a2fdb9c4633819322
4653
4637
2021-11-16T13:49:47Z
Rew
3
/* Write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x10-0x11 || 8 bit register. Reserved for debug. Do not write to these registers.
|-
| 0x12 || 8 bit register. Each bit controls the enable of an output. If disabled (0) the output drops to zero. Some servos stop wiggling, become back-drivable and consume less power in this state.
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 timing in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0x50 || (#) set servo values as an array. Write 1-7 servo position bytes (always starting at servo 0) in one transaction.
|-
| 0x51 || (#) set servo values as an array. Write 1-7 servo timing values (16 bits/servo) in one transaction.
|-
| 0x58 || (#) 8bit servo positions are converted to 16 bit timing values using tv = base + pos*mul; default base = 988 giving the normal 1000-2000 microsecond timing value range. This register is 16 bits and modifies the base.
|-
| 0x59 || (#) this changes the multiplication factor. See 0x58.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
(#) From version 2.1 and up. (0x50 from 2.0)
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
fdb4bd4e4eac42db7f43b49332277e7936acfa18
4654
4653
2021-11-16T13:50:45Z
Rew
3
/* Write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x10-0x11 || 8 bit register. Reserved for debug. Do not write to these registers.
|-
| 0x12 || 8 bit register. Each bit controls the enable of an output. If disabled (0) the output drops to zero. Some servos stop wiggling, become back-drivable and consume less power in this state.
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1ms for 0 to about 2ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e or adjust the offset and scaling using 0x58/0x59.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 timing in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0x50 || (#) set servo values as an array. Write 1-7 servo position bytes (always starting at servo 0) in one transaction.
|-
| 0x51 || (#) set servo values as an array. Write 1-7 servo timing values (16 bits/servo) in one transaction.
|-
| 0x58 || (#) 8bit servo positions are converted to 16 bit timing values using tv = base + pos*mul; default base = 988 giving the normal 1000-2000 microsecond timing value range. This register is 16 bits and modifies the base.
|-
| 0x59 || (#) this changes the multiplication factor. See 0x58.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
(#) From version 2.1 and up. (0x50 from 2.0)
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
d073f6d4c0bd343a415b0b16ff24df10aa2ba89c
4655
4654
2021-11-16T13:51:17Z
Rew
3
/* Write ports */
wikitext
text/x-wiki
= Introduction =
The protocol for the SERVO boards will be explained on this page.
This page describes both the SPI and the I2C version. See [[SPI versus I2C protocols]] for the explanation about how the protocols work in general.
The default address of the servo board is 0x86.
= Write ports =
The ports on the servo board just set a single byte-value. So writing more than one byte to such a port is redundant.
The spi_servo board defines several ports.
{| border=1
! port !! function
|-
| 0x10-0x11 || 8 bit register. Reserved for debug. Do not write to these registers.
|-
| 0x12 || 8 bit register. Each bit controls the enable of an output. If disabled (0) the output drops to zero. Some servos stop wiggling, become back-drivable and consume less power in this state.
|-
| 0x20-0x26 || 8 bit register. Set servo 0-6 position. The pulse width changes from about 1.00ms for 0 to about 2.00ms for 0xff. To "overdrive" your servos you need to use 0x28-0x2e or adjust the offset and scaling using 0x58/0x59.
|-
| 0x28-0x2e || (*) 16 bit register. Set servo 0-6 timing in microseconds. Don't set values larger than 2500. (if you do, funny things will happen if the total of all servos exceeds 20 miliseconds. Don't set the value too low. I expect you'll get pulses that are 20 miliseconds too long if you do.
|-
| 0x30-0x36 || (*) 8 bit register. Set the default value for this servo. This value is used when the board is powered up. This value is stored in non volatile memory.
|-
| 0x38-0x3e || (*) 8 bit register. Set the timeout value in tenths of a second. (5 = 0.5 seconds, 35=3.5 seconds). If no update of this servo is received within the timeout time, the servo will revert to the default value.
|-
| 0x50 || (#) set servo values as an array. Write 1-7 servo position bytes (always starting at servo 0) in one transaction.
|-
| 0x51 || (#) set servo values as an array. Write 1-7 servo timing values (16 bits/servo) in one transaction.
|-
| 0x58 || (#) 8bit servo positions are converted to 16 bit timing values using tv = base + pos*mul; default base = 988 giving the normal 1000-2000 microsecond timing value range. This register is 16 bits and modifies the base.
|-
| 0x59 || (#) this changes the multiplication factor. See 0x58.
|-
| 0xf0 || Change address. Requires a write to 0xf1 and 0xf2 first.
|-
| 0xf1 || Write 0x55 here to start unlocking the change address register.
|-
| 0xf2 || Write 0xaa here to unlock the change address register.
|}
(*) From version 1.1 and up.
(#) From version 2.1 and up. (0x50 from 2.0)
= Read ports =
The spi_servo board supports two read ports:
{| border=1
! port !! function
|-
| 0x01 || identification string. (terminated with 0).
|-
| 0x20-0x3e || read the corresponding write register.
|}
= Examples =
For SPI in the examples below, "data sent" means the data on the MOSI line, while "data received" means the data on the MISO line. when MISO reads "xx" you should ignore the data. When MOSI reads "xx" it doesn't matter what you send.
For I2C in the examples below, you should first initiate a "write" transaction with the data in the "data sent column". Don't send the "xx" bytes. Then you initiate a "read" transaction, and you will get the data in the "data received" column (and again not the "xx" bytes).
== Read identification ==
read the identification string of the board. ('spi_servo 1.0').
{| border=1
! data sent !! data recieved || explanation
|-
| 0x87 || xx || select destination with address 0x86 for READ.
|-
| 0x01 || xx || identify
|-
| xx || 0x73 || 's'
|-
| xx || 0x70 || 'p'
|-
| xx || 0x69 || 'i'
|-
| xx || ... || etc.
|}
bdd06b8b3e947325c07bb2bf83ba17a27e724917
Usb ws2812
0
1837
4638
4331
2021-01-20T12:34:45Z
Rew
3
/* fade */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
b3ef39ea6013c17958594c12be546c9d57e908a6
4639
4638
2021-01-20T12:35:09Z
Rew
3
/* Changelog */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the ledd strip to one of the data pins on the USB_WS2812 board.
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
68c55a44df4be1551a0df7d556588ae0860c7529
4640
4639
2021-01-20T12:39:29Z
Rew
3
/* wiring */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D7 || Data for led-chain 7.
|-
| GND || 3 || 4 || D6 || Data for led-chain 6.
|-
| GND || 5 || 6 || D5 || Data for led-chain 5.
|-
| GND || 7 || 8 || D4 || Data for led-chain 4.
|-
| GND || 9 || 10 || D3 || Data for led-chain 3.
|-
| GND || 11 || 12 || D2 || Data for led-chain 2.
|-
| GND || 13 || 14 || D1 || Data for led-chain 1.
|-
| GND || 15 || 16 || D0 || Data for led-chain 0.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". Soonish you will be able to set the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D", "DI", "I", "IN" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips. If you have the board upright, USB on the left, bitwizard logo correctly oriented, pin 1 is on the right. Take care not to reverse your led strip: It kills the leds instantly.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the led strip to one of the data pins on the USB_WS2812 board.
The 8 datalines count from bottom to top, D0..D7. The datalines are on the left (next to the resistors), and the GND for each strip is on the right (next to our logo).
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
02577078df035891344591b6c3579035f83934bd
4641
4640
2021-01-20T13:03:25Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D0 || Data for led-chain 0.
|-
| GND || 3 || 4 || D1 || Data for led-chain 1.
|-
| GND || 5 || 6 || D2 || Data for led-chain 2.
|-
| GND || 7 || 8 || D3 || Data for led-chain 3.
|-
| GND || 9 || 10 || D4 || Data for led-chain 4.
|-
| GND || 11 || 12 || D5 || Data for led-chain 5.
|-
| GND || 13 || 14 || D6 || Data for led-chain 6.
|-
| GND || 15 || 16 || D7 || Data for led-chain 7.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Or closer resembling the layout on the board:
{| border=1
! function !! pin !! pin !! function
|-
| D7 || 16 || 15 || GND || Data for led-chain 7.
|-
| D6 || 14 || 13 || GND || Data for led-chain 6.
|-
| D5 || 12 || 11 || GND || Data for led-chain 5.
|-
| D4 || 10 || 9 || GND || Data for led-chain 4.
|-
| d3 || 8 || 7 || GND || Data for led-chain 3.
|-
| D2 || 6 || 5 || GND || Data for led-chain 2.
|-
| D1 || 4 || 3 || GND || Data for led-chain 1.
|-
| D0 || 2 || 1 || GND || Data for led-chain 0.
|-
|}
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". You can configure the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D", "DI", "I", "IN" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips. If you have the board upright, USB on the left, bitwizard logo correctly oriented, pin 1 is on the right. Take care not to reverse your led strip: It kills the leds instantly.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the led strip to one of the data pins on the USB_WS2812 board.
The 8 datalines count from bottom to top, D0..D7. The datalines are on the left (next to the resistors), and the GND for each strip is on the right (next to our logo).
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
e08e6f56aa5e4c706ac5578160957e3080ed97a3
4642
4641
2021-01-20T13:04:32Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D0 || Data for led-chain 0.
|-
| GND || 3 || 4 || D1 || Data for led-chain 1.
|-
| GND || 5 || 6 || D2 || Data for led-chain 2.
|-
| GND || 7 || 8 || D3 || Data for led-chain 3.
|-
| GND || 9 || 10 || D4 || Data for led-chain 4.
|-
| GND || 11 || 12 || D5 || Data for led-chain 5.
|-
| GND || 13 || 14 || D6 || Data for led-chain 6.
|-
| GND || 15 || 16 || D7 || Data for led-chain 7.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Or closer resembling the layout on the board:
{| border=1
! function !! pin !! pin !! function
|-
| D7 || 16 || 15 || GND || two pins for led-chain 7.
|-
| D6 || 14 || 13 || GND || two pins for led-chain 6.
|-
| D5 || 12 || 11 || GND || two pins for led-chain 5.
|-
| D4 || 10 || 9 || GND || two pins for led-chain 4.
|-
| d3 || 8 || 7 || GND || two pins for led-chain 3.
|-
| D2 || 6 || 5 || GND || two pins for led-chain 2.
|-
| D1 || 4 || 3 || GND || two pins for led-chain 1.
|-
| D0 || 2 || 1 || GND || two pins for led-chain 0.
|-
|}
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". You can configure the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D", "DI", "I", "IN" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips. If you have the board upright, USB on the left, bitwizard logo correctly oriented, pin 1 is on the right. Take care not to reverse your led strip: It kills the leds instantly.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the led strip to one of the data pins on the USB_WS2812 board.
The 8 datalines count from bottom to top, D0..D7. The datalines are on the left (next to the resistors), and the GND for each strip is on the right (next to our logo).
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
c1d6ef538ca31c84e8842d01816ab4c4d81dfdf0
4643
4642
2021-01-20T13:09:14Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D0 || Data for led-chain 0.
|-
| GND || 3 || 4 || D1 || Data for led-chain 1.
|-
| GND || 5 || 6 || D2 || Data for led-chain 2.
|-
| GND || 7 || 8 || D3 || Data for led-chain 3.
|-
| GND || 9 || 10 || D4 || Data for led-chain 4.
|-
| GND || 11 || 12 || D5 || Data for led-chain 5.
|-
| GND || 13 || 14 || D6 || Data for led-chain 6.
|-
| GND || 15 || 16 || D7 || Data for led-chain 7.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Or closer resembling the layout on the board:
{| border=1
! function !! pin !! pin !! function
|-
| D7 || 16 || 15 || GND || two pins for led-chain 7.
|-
| D6 || 14 || 13 || GND || two pins for led-chain 6.
|-
| D5 || 12 || 11 || GND || two pins for led-chain 5.
|-
| D4 || 10 || 9 || GND || two pins for led-chain 4.
|-
| d3 || 8 || 7 || GND || two pins for led-chain 3.
|-
| D2 || 6 || 5 || GND || two pins for led-chain 2.
|-
| D1 || 4 || 3 || GND || two pins for led-chain 1.
|-
| D0 || 2 || 1 || GND || two pins for led-chain 0.
|-
|}
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". You can configure the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board. There is SWD: Single Wire Debug. This helps us develop software. For hacking: pin1 is 3V3 and pin 3 is GND. There is also a connector SPI. This was meant to allow this board to prototype getting the led-data over SPI, or possibly control other modules over SPI.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D", "DI", "I", "IN" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips. If you have the board upright, USB on the left, bitwizard logo correctly oriented, pin 1 is on the right. Take care not to reverse your led strip: It kills the leds instantly.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the led strip to one of the data pins on the USB_WS2812 board.
The 8 datalines count from bottom to top, D0..D7. The datalines are on the left (next to the resistors), and the GND for each strip is on the right (next to our logo).
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for 30 years. "Minicom" is also a good option)
The board supports the following commands:
=== help ===
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
=== pix ===
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
=== lshift and rshift ===
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
=== rainbow ===
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
=== white ===
will set all leds to white.
=== black ===
will set all leds off (black).
=== color ===
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
=== fade ===
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
=== uid ===
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
2a6ff2e112cff653ead793202fc110d87ed8b0b1
4644
4643
2021-01-26T17:28:52Z
Rew
3
/* Protocol */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D0 || Data for led-chain 0.
|-
| GND || 3 || 4 || D1 || Data for led-chain 1.
|-
| GND || 5 || 6 || D2 || Data for led-chain 2.
|-
| GND || 7 || 8 || D3 || Data for led-chain 3.
|-
| GND || 9 || 10 || D4 || Data for led-chain 4.
|-
| GND || 11 || 12 || D5 || Data for led-chain 5.
|-
| GND || 13 || 14 || D6 || Data for led-chain 6.
|-
| GND || 15 || 16 || D7 || Data for led-chain 7.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Or closer resembling the layout on the board:
{| border=1
! function !! pin !! pin !! function
|-
| D7 || 16 || 15 || GND || two pins for led-chain 7.
|-
| D6 || 14 || 13 || GND || two pins for led-chain 6.
|-
| D5 || 12 || 11 || GND || two pins for led-chain 5.
|-
| D4 || 10 || 9 || GND || two pins for led-chain 4.
|-
| d3 || 8 || 7 || GND || two pins for led-chain 3.
|-
| D2 || 6 || 5 || GND || two pins for led-chain 2.
|-
| D1 || 4 || 3 || GND || two pins for led-chain 1.
|-
| D0 || 2 || 1 || GND || two pins for led-chain 0.
|-
|}
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". You can configure the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board. There is SWD: Single Wire Debug. This helps us develop software. For hacking: pin1 is 3V3 and pin 3 is GND. There is also a connector SPI. This was meant to allow this board to prototype getting the led-data over SPI, or possibly control other modules over SPI.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D", "DI", "I", "IN" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips. If you have the board upright, USB on the left, bitwizard logo correctly oriented, pin 1 is on the right. Take care not to reverse your led strip: It kills the leds instantly.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the led strip to one of the data pins on the USB_WS2812 board.
The 8 datalines count from bottom to top, D0..D7. The datalines are on the left (next to the resistors), and the GND for each strip is on the right (next to our logo).
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for over 30 years. "Minicom" is also a good option)
=== specifying pixel colors ===
Adressable leds are starting to appear that have 32 bits driving RGBW 4 different color leds, while the original WS2812 leds have 24 bits driving RGB 3 colored leds.
On a hardware level WS2812 leds want the data in GRB order. Because everybody says "RGB" it is easier to memorize that the order of the colors are RGB. So the board translates this for you.
So when you need to specify a color for a WS2812 (or compatible 24-bit) led, you specify rrggbb: Two hex digits for each color. You may omit leading zeros if you want, to the firmware in your usb-ws2812 it is just a number.
To keep existing software compatible with this, the format for 32-bit leds is WRGB: you specify 8 hex digits, wwrrggbb. Again, leading zeros may be omitted, so when you just specify rrggbb, the white led simply won't be driven.
=== list of commands ===
The board supports the following commands:
==== help ====
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
==== pix ====
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
==== lshift and rshift ====
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
==== rainbow ====
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
==== white ====
will set all leds to white.
==== black ====
will set all leds off (black).
==== color ====
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
==== fade ====
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
==== uid ====
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
==== rbl ====
Reset to bootloader.
Should you need to upgrade the firmware, this will Reset the device into the BootLoader. On older versions you had to keep the button pressed while plugging the device into the USB cable. That would still be the recovery procedure if say a firmware is downloaded that crashes before it provides the virtual com port.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
3f84706c31dc1946253a5eccf140115e98f60b2a
4645
4644
2021-01-26T17:43:33Z
Rew
3
/* rbl */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D0 || Data for led-chain 0.
|-
| GND || 3 || 4 || D1 || Data for led-chain 1.
|-
| GND || 5 || 6 || D2 || Data for led-chain 2.
|-
| GND || 7 || 8 || D3 || Data for led-chain 3.
|-
| GND || 9 || 10 || D4 || Data for led-chain 4.
|-
| GND || 11 || 12 || D5 || Data for led-chain 5.
|-
| GND || 13 || 14 || D6 || Data for led-chain 6.
|-
| GND || 15 || 16 || D7 || Data for led-chain 7.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Or closer resembling the layout on the board:
{| border=1
! function !! pin !! pin !! function
|-
| D7 || 16 || 15 || GND || two pins for led-chain 7.
|-
| D6 || 14 || 13 || GND || two pins for led-chain 6.
|-
| D5 || 12 || 11 || GND || two pins for led-chain 5.
|-
| D4 || 10 || 9 || GND || two pins for led-chain 4.
|-
| d3 || 8 || 7 || GND || two pins for led-chain 3.
|-
| D2 || 6 || 5 || GND || two pins for led-chain 2.
|-
| D1 || 4 || 3 || GND || two pins for led-chain 1.
|-
| D0 || 2 || 1 || GND || two pins for led-chain 0.
|-
|}
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". You can configure the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board. There is SWD: Single Wire Debug. This helps us develop software. For hacking: pin1 is 3V3 and pin 3 is GND. There is also a connector SPI. This was meant to allow this board to prototype getting the led-data over SPI, or possibly control other modules over SPI.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D", "DI", "I", "IN" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips. If you have the board upright, USB on the left, bitwizard logo correctly oriented, pin 1 is on the right. Take care not to reverse your led strip: It kills the leds instantly.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the led strip to one of the data pins on the USB_WS2812 board.
The 8 datalines count from bottom to top, D0..D7. The datalines are on the left (next to the resistors), and the GND for each strip is on the right (next to our logo).
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for over 30 years. "Minicom" is also a good option)
=== specifying pixel colors ===
Adressable leds are starting to appear that have 32 bits driving RGBW 4 different color leds, while the original WS2812 leds have 24 bits driving RGB 3 colored leds.
On a hardware level WS2812 leds want the data in GRB order. Because everybody says "RGB" it is easier to memorize that the order of the colors are RGB. So the board translates this for you.
So when you need to specify a color for a WS2812 (or compatible 24-bit) led, you specify rrggbb: Two hex digits for each color. You may omit leading zeros if you want, to the firmware in your usb-ws2812 it is just a number.
To keep existing software compatible with this, the format for 32-bit leds is WRGB: you specify 8 hex digits, wwrrggbb. Again, leading zeros may be omitted, so when you just specify rrggbb, the white led simply won't be driven.
=== list of commands ===
The board supports the following commands:
==== help ====
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
==== pix ====
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
==== lshift and rshift ====
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are two arguments. the starting position and the number of pixels to involve in the shift. Default is to start at zero and "all pixels".
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
==== rainbow ====
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
==== white ====
will set all leds to white.
==== black ====
will set all leds off (black).
==== color ====
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
==== fade ====
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
==== uid ====
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
==== rbl ====
Reset to BootLoader.
Should you need to upgrade the firmware, this will Reset the device into the BootLoader. On older versions you had to keep the button pressed while plugging the device into the USB cable. That would still be the recovery procedure if say a firmware is downloaded that crashes before it provides the virtual com port.
==== bitsperled ====
Without an argument it will print the current setting. If you provide an argument you can set it. Only 24 and 32 are currently allowed.
==== write ====
write the current settings to non volatile memory so that they will apply after the next powercycle. In the past, this module wrote changed settings to flash immediately. However for consistency we're moving to just modifying the active settings with the commands and then requiring a "write" to make these settings permanent.
Currently "bitsperled" is the only setting that requires the write.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
6de0a49bbec521c8fc73c48d8c79d30143521fba
4652
4645
2021-08-23T09:12:40Z
Rew
3
/* lshift and rshift */
wikitext
text/x-wiki
[[File:ws2812.jpg|thumb|300px|alt=The USB_WS2812 board|The USB_WS2812 board]]
This is the documentation page for the USB_WS2812 board. That you can buy in the [http://www.bitwizard.nl/shop/index.php?route=product/product&product_id=161&search=ws2812 BitWizard shop].
== Overview ==
This board enables you to drive up to 600 WS2812 fullcolor RGB leds. These leds are sometimes called "neopixels". The board can drive up to 75 leds in in 8 strings. Due to the way things are implemented it is not possible to drive a single string of say 600 leds. Furthermore you would not want that: for each led on a string there is a fixed amount of time necessary for sending its data. Too many leds and the refresh rate has to drop!
== Assembly instructions ==
None: the board comes fully assembled.
== External resources ==
=== Datasheets ===
[http://www.bitwizard.nl/pdf/WS2812B.pdf The datasheet of the WS2812B chip/led.]
== Additional software ==
=== Related projects ===
== Pinout ==
The USB connector is a standard micro USB connector.
Pinout of the 16-pin header:
{| border=1
! function !! pin !! pin !! function
|-
| GND || 1 || 2 || D0 || Data for led-chain 0.
|-
| GND || 3 || 4 || D1 || Data for led-chain 1.
|-
| GND || 5 || 6 || D2 || Data for led-chain 2.
|-
| GND || 7 || 8 || D3 || Data for led-chain 3.
|-
| GND || 9 || 10 || D4 || Data for led-chain 4.
|-
| GND || 11 || 12 || D5 || Data for led-chain 5.
|-
| GND || 13 || 14 || D6 || Data for led-chain 6.
|-
| GND || 15 || 16 || D7 || Data for led-chain 7.
|-
|}
Note, pin one of this connector is bottom-right when the logo is right-side up. Pin 16 is top-left. All the pins on the right are all ground, the pins on the left are the data pins.
Or closer resembling the layout on the board:
{| border=1
! function !! pin !! pin !! function
|-
| D7 || 16 || 15 || GND || two pins for led-chain 7.
|-
| D6 || 14 || 13 || GND || two pins for led-chain 6.
|-
| D5 || 12 || 11 || GND || two pins for led-chain 5.
|-
| D4 || 10 || 9 || GND || two pins for led-chain 4.
|-
| d3 || 8 || 7 || GND || two pins for led-chain 3.
|-
| D2 || 6 || 5 || GND || two pins for led-chain 2.
|-
| D1 || 4 || 3 || GND || two pins for led-chain 1.
|-
| D0 || 2 || 1 || GND || two pins for led-chain 0.
|-
|}
Each pin controls a number of leds. On the current version that number is 384. On a previous version it was 75. Let's call that number "N". You can configure the number of leds per string up to the maximum of the board.
{| border=1
! pin !! leds
|-
| D0 || 0 - N-1
|-
| D1 || N - 2*N -1
|-
| D2 || 2*N - 3 * N-1
|-
| D3 || 3*N - 4 * N-1
|-
| D4 || 4*N - 5 * N-1
|-
| D5 || 5*N - 6 * N-1
|-
| D6 || 6*N - 7 * N-1
|-
| D7 || 7*N - 8 * N-1
|-
|}
There is also a three-pin test-connector. It has Ground-data-VCC as the pinout. The data pin is "D0" on the big connector. This will use the USB-5V for the leds. As each led consumes up to 60mA, you are only allowed to power up 8 leds through this connector before you hit the USB 500mA currentlimit. But this could be an easy way to quickly test led-strips if they work, by programming for example a walking led, you verify each of the leds in sequence.
Please ignore the other connectors on the board. There is SWD: Single Wire Debug. This helps us develop software. For hacking: pin1 is 3V3 and pin 3 is GND. There is also a connector SPI. This was meant to allow this board to prototype getting the led-data over SPI, or possibly control other modules over SPI.
=== wiring ===
Your WS2812 led string has three wires. One is usually marked "GND" or "V-", one is marked "VCC" or "V+" and the last is the data-in, marked "D", "DI", "I", "IN" or "Din".
Our WS2812 board has a three pin ground-data-vcc connector. This is for "quick test" purposes: The usb powersupply of the board is not able to provide current for more than a few leds (about ten). The quick test connector has pinout ground-data-vcc, just like most WS2812 led strips. If you have the board upright, USB on the left, bitwizard logo correctly oriented, pin 1 is on the right. Take care not to reverse your led strip: It kills the leds instantly.
When you are ready to connect longer strips, you need to have a separate 5V supply for the led strip. Connect the 0 and 5V of the powersupply to the GND (V-) and VCC (V+) of the led strip. Then connect the GND (V-) Of the led strip to the GND of the USB_WS2812 board. And connect the Din of the led strip to one of the data pins on the USB_WS2812 board.
The 8 datalines count from bottom to top, D0..D7. The datalines are on the left (next to the resistors), and the GND for each strip is on the right (next to our logo).
=== LEDs ===
There are two leds. One is the power led. It should be lit whenever the USB is connected. The other should blink every two seconds (one second on, one second off).
=== Button ===
There is also a button on the board. If you press the button and then power up the board, it will come up in DFU mode, allowing you to upgrade the firmware of the board.
== Jumper settings ==
This board has no jumpers.
== Protocol ==
When you connect the board to your PC or raspberry PI, you will get a virtual com port. You can use your favorite communications program to talk to the device. (I personally use "kermit" because I've been using that for over 30 years. "Minicom" is also a good option)
=== specifying pixel colors ===
Adressable leds are starting to appear that have 32 bits driving RGBW 4 different color leds, while the original WS2812 leds have 24 bits driving RGB 3 colored leds.
On a hardware level WS2812 leds want the data in GRB order. Because everybody says "RGB" it is easier to memorize that the order of the colors are RGB. So the board translates this for you.
So when you need to specify a color for a WS2812 (or compatible 24-bit) led, you specify rrggbb: Two hex digits for each color. You may omit leading zeros if you want, to the firmware in your usb-ws2812 it is just a number.
To keep existing software compatible with this, the format for 32-bit leds is WRGB: you specify 8 hex digits, wwrrggbb. Again, leading zeros may be omitted, so when you just specify rrggbb, the white led simply won't be driven.
=== list of commands ===
The board supports the following commands:
==== help ====
Print a list of supported commands, and also the compilation time of the firmware.
You might see a few commands that are there for debugging purposes. Consider those not described here as "do not use".
==== pix ====
pix <num> <color>
Set pixel "num" to color "color". Color is specified in 6 hexadecimal digits specifying the color in RGB order. Specifying 102030 will set the red component to 0x10, or about 1/16th of full intensity, the green component to 0x20/0xff or aobut 1/8th of full intensity and blue to about 3/16th.
==== lshift and rshift ====
Shift a range of pixels one pixel left (towards the controller) or right (away from the controller).
There are three arguments. The starting position and the number of pixels to involve in the shift and the number of pixels to shift (i.e. shift by 3 pixels). Default is to start at zero and "all pixels", and just one position.
example:
lshift 50 60 3
will shift pixels 50-109 by three pixels. (pixel 50 gets the value from pixel 53, 51 from 54 etc.).
The maximum number of pixels you can shift in one go is 10 at the moment.
If you give only one argument, the starting position defaults to zero, if you give two arguments, the first is the starting position the second is the number of pixels.
==== rainbow ====
Create a rainbow color effect.
rainbow [start] [nleds]
will create a rainbow starting at the led "start" and extend over "nleds" leds. The rainbow starts with red, fades via yellow, green, cyan, blue, violet back to red, so it is cyclic.
==== white ====
will set all leds to white.
==== black ====
will set all leds off (black).
==== color ====
sets a fixed color.
color <color> [start] [nleds]
Sets "nleds" starting at "start" to the color specified by "color".
==== fade ====
creates a fade from one color to another color.
fade <start> <nleds> <color1> <color2>
This is one of the latest commands added. Some of the boards in the field do not have this yet.
==== uid ====
print the unique identifier for this board.
Some chips have a Unique identifier on board. This one does. It gets formatted to readable ascii and printed with this command. If you have multiple boards, you can use this to keep them apart.
==== rbl ====
Reset to BootLoader.
Should you need to upgrade the firmware, this will Reset the device into the BootLoader. On older versions you had to keep the button pressed while plugging the device into the USB cable. That would still be the recovery procedure if say a firmware is downloaded that crashes before it provides the virtual com port.
==== bitsperled ====
Without an argument it will print the current setting. If you provide an argument you can set it. Only 24 and 32 are currently allowed.
==== write ====
write the current settings to non volatile memory so that they will apply after the next powercycle. In the past, this module wrote changed settings to flash immediately. However for consistency we're moving to just modifying the active settings with the commands and then requiring a "write" to make these settings permanent.
Currently "bitsperled" is the only setting that requires the write.
== Future hardware enhancements ==
None known yet. (Let us know if you have a request).
== Future software enhancements ==
None known yet.
== Changelog ==
This is the HARDWARE changelog.
=== 1.0 ===
* nov 2015 Initial version
=== 1.1 ===
* dec 2015 minor fixes.
=== 1.2 ===
* dec 2016 added SPI connector.
c8c67fac226cdd753f4fb3e9bba4c7b623519939
Main Page
0
1
4646
4192
2021-04-09T10:18:24Z
Rew
3
/* Other boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= DMX =
* [[Dmx interface for raspberry pi]]
* [[Assembling the DMX case]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Developement boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
* [[pwm16]]
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS receiver connected to Raspberry Pi]]
* [[User Interface]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function in bar at the top (on the right).
* [http://www.bitwizard.nl/contact.php Contact us]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
fdb746de0e02dd66c3071ec54e99a0e7b195e281
4651
4646
2021-06-14T04:27:49Z
Rew
3
/* Developement boards */
wikitext
text/x-wiki
<big>'''BitWizard documentation wiki.'''</big>
This WIKI is for documentation of the BitWizard SPI/I2C expansion system and other boards, available from the [http://www.bitwizard.nl/catalog/ BitWizard Shop]. If you are considering adding information that is not related to one of our products, please contact us beforehand.<br>
It is expressly forbidden to add information intended to promote other sites. It is expressly forbidden to have a program add accounts and add articles with links to other sites.
= How-to's =
* [[Beginners guide to SPI on Raspberry Pi]]
* [[Installing and booting FriendlyArm mini6410]]
= DMX =
* [[Dmx interface for raspberry pi]]
* [[Assembling the DMX case]]
= Kits =
* [[RGB clock]]
* [[Raspberry Pi camera extension kit]]
= Development boards =
* [[Raspduino]]
* [[FTDI_ATmega]]
* [[USB-multio]]
* [[Usbbigmultio]]
* [[Cyclone dev board]]
= Expansion boards =
== General ==
* [[Default addresses]] (both SPI and I2C)
* [[SPI versus I2C protocols]]
* [[Daisy-chaining BitWizard I2C boards]]
* [[USB Relay]]
* [[Model B+ compatibility]]
== Board specific pages ==
These expansion boards come in I2C and SPI versions, and thus can be connected to a single bus. This allows you to easily expand your microcontroller system with new functions, without the cost of additional I/O pins.
* [[LCD|LCD]]
* [[DIO|DIO]]
* [[Servo|Servo]]
* [[7FETs|7FETs]]
* [[3FETs|3FETs]]
* [[temp|Temperature Interface]]
* [[relay|Relay/BigRelay]]
* [[motor|Motor]]
<!--
* [[PiPower|PiPower]]
-->
* [[Raspberry Juice]]
* [[Raspberry Relay]]
* [[User Interface|User Interface]]
* [[7_Segment]]
<!--
* [[SPI_SPI]]
-->
* [[Pushbutton]]
* [[Rtc]]
* [[Dimmer]]
* [[16 LEDs]]
== Other boards ==
* [[USB-SATA powerswitch]]
* [[USB-opto]]
* [[Servotester]]
* [[USB-step]]
* [[Usb ws2812]]
<!--
* [[USB relay board]]
-->
* [[pwm16]]
= Breakout boards =
* [[Raspberry Pi Serial]]
* [[Dio breakout]]
== FTDI chips ==
* [[FT201X]] USB I2C slave
* [[FT220X]] USB 4-bit SPI/FT1248
* [[FT221X]] USB 8-bit SPI/FT1248
* [[FT230X]] USB to basic UART
* [[FT231X]] USB to full handshake UART
* [[FT240X]] USB 8-bit FIFO
* [[FT245RL V1.5]] USB FIFO
* [[FT311D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT312D]] USB Android host, compatible with AOA (Android Open Accessory)
* [[FT245RL breakout board]]
* [[FT2232H breakout board]]
* [[FTDI serial]]
* [[FTDI serial 2]]
== I2C chips ==
* [[I2C DAC|Dual MCP4726 DAC]]
* [[I2C ADC|MCP3424 ADC]]
* [[I2C splitter|PCA9548A I2C switch/mux]]
* [[IO Expander|MCP23008 IO Expander]]
* [[I2C accellerometer]]
* [[I2C magnetometer]]
* [[I2C pressure sensor]]
== SPI chips ==
* [[IO Expander|MCP23S08 IO Expander]]
* [[SPI DAC|MCP4822 DAC]]
= Sample programs =
* [[Usbio kitt]]
* [[Usbio ACM sample program]]
* [[Raspberry Pi LCD program]]
<!--
= Preparing your development environment =
* [[Linux]]
* [[Windows]]
* [[MacOS]]
-->
= Sample projects =
* [[Temperature control]] (ftdi_atmega, spi_temp, spi_relay).
= Raspberry Pi projects =
* [[Reducing power consumption of a raspberry Pi]]
* [[LCD + 3FETs demonstration|Connecting two 1602 LCDs and an RGB LED Strip to a Raspberry Pi]]
* [[Connecting a motor and 1602 LCD to a Raspberry Pi]]
* [[MPU-6050 sensor connected to Raspberry Pi]]
* [[Raspberry pi expansion system page]]
* [[GPS receiver connected to Raspberry Pi]]
* [[User Interface]]
= Help! =
If you have trouble finding things on this wiki you can:
* Use the search function in bar at the top (on the right).
* [http://www.bitwizard.nl/contact.php Contact us]
= Miscellaneous =
* [[Solder jumpers]]
* [[SPI_connector_pinout]]
* [[Template]]
* [[Nikon D80 wired remote]]
* [[Iphone 3GS camera]]
5567d9f1710a172588c00ffd8d0f7ca2a91391ab
Pwm16
0
2190
4647
2021-04-12T11:53:07Z
Rew
3
Created page with "== PWM16 == The board comes in two variants, the -b suffix has bigger FETs. === specifications === * PCA9685 PWM chip. * Each channel drives a N-channel mosfet. ** Note..."
wikitext
text/x-wiki
== PWM16 ==
The board comes in two variants, the -b suffix has bigger FETs.
=== specifications ===
* PCA9685 PWM chip.
* Each channel drives a N-channel mosfet.
** Note when switching a load with an N-channel mosfet, the load is wired with its positive directly
connected to power and the mosfet will switch the negative terminal of your load.
* For ease of hooking up, each channel has a power and a switched connection.
The small fets can handle 1A each. Running a total of 16A through the whole board will heat it up a bit, but should still work. Slightly more than 1A is permissible, provided it doens't last too long. But keep in mind that electronics works on a different timescale. "a second" Is already a very long time for such a small component.
The big fets can handle 5A each. But running 80A through the whole board is going to heat it up beyond permissible limits. Again a bit more for a short period can be permitted, but timescale of "a few milli seconds" and not "a few seconds".
=== pinout ===
Bottom edge has outputs 1-8, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
Top edge has outputs 1-8, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
The right edge of the PCB has 6 connections: GND, V1, V1, GND, V2, V2. The power connections are separate. This alows you to run one side of the PCB at a different voltage than the other side. Say 5V on V2 for the top edge of the board, and 12V for the bottom edge. There are two Vx connectors to make it easy to connect one powersupply by looping a sort wire from the second V1 to V2.
=== Usage ===
For full documentation see the PCA9685 datasheet.
To initialize I
* set register 0xfe to 5
* set register 0 to 0x20.
Now the chip is initialized and will do about 1500Hz PWM
3c9696d6907ebb72000e35bf1c3ca9d3ef629eae
4658
4647
2022-03-10T10:21:18Z
Rew
3
wikitext
text/x-wiki
== PWM16 ==
The board comes in two variants, the -b suffix has bigger FETs.
=== specifications ===
* PCA9685 PWM chip.
* Each channel drives a N-channel mosfet.
** Note when switching a load with an N-channel mosfet, the load is wired with its positive directly
connected to power and the mosfet will switch the negative terminal of your load.
* For ease of hooking up, each channel has a power and a switched connection.
The small fets can handle 1A each. Running a total of 16A through the whole board will heat it up a bit, but should still work. Slightly more than 1A is permissible, provided it doesn't last too long. But keep in mind that electronics works on a different timescale. "a second" Is already a very long time for such a small component.
The big fets can handle 5A each. But running 80A through the whole board is going to heat it up beyond permissible limits. Again a bit more for a short period can be permitted, but timescale of "a few milli seconds" and not "a few seconds".
=== pinout ===
Bottom edge has outputs 1-8, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
Top edge has outputs 9-16, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
The right edge of the PCB has 6 connections: GND, V1, V1, GND, V2, V2. The power connections are separate. This alows you to run one side of the PCB at a different voltage than the other side. Say 5V on V2 for the top edge of the board, and 12V for the bottom edge. There are two Vx connectors to make it easy to connect one powersupply by looping a sort wire from the second V1 to V2.
=== Usage ===
For full documentation see the PCA9685 datasheet.
To initialize:
* set register 0xfe to 5
* set register 0 to 0x20.
Now the chip is initialized and will do about 1500Hz PWM
To set a channel, write 4 bytes to an address 6+ 4*<channel number> . The first two bytes are the turn-on-timestamp. Write 0x00 0x00. The second two are the turn-off-time. So values 0...0x0fff will set the PWM value (low byte first!). The highest value now will still have the output "off" for 1/4096 period. To turn the output fully on, you need to set the "always on" bit, which is in the "turn on" register that we've been setting to zero. So to turn it fully on send 0x00 0x10 0x00 0x00.
OPTIONAL: if you don't understand this, ignore it.
There are different ways to configure the chip. For example, if you want to set five channels to 0x203, 0x405, 0x607, 0x809 and 0xa0b, the above recommendation works, but it loads your powersupply a bit weird. I've chosen the PWM values a bit wonky so that you can see where the differnt parts go: So above would send '''00 00 03 02, 00 00 05 04, 00 00 07 06, 00 00 09 08, 00 00 0b 0a''' (if the channels are consecutive you can send all that in one go!). In this configuration all five loads are loading the powersupply from 000 to 0203 in each PWM period. And none are loading the powersupply from 0a0b to 0fff.
But slightly easier on the power supply would be: '''00 00 03 02''': First channel is on from 000 to 0203. Then '''03 02 08 06''': second channel is on from 0203 to 0608. Then '''08 06 0f 0c''': third channel on from 0608 to 0c0f. Then '''0f 0c 18 04''': the fourth channel wraps around: it is on from 0c0f to 0418! Continue with '''18 04 23 0e''' and now from 000 to 0e23 two loads are loading the powersupply and from 0e23 to 0fff only one: The variation in load on the powersupply is much less. This strategy works very good when the loads are all identical. When the loads are not identical the calculations become more complex.
40d4387bc20e4e55b5bea3ea0293899ab5148f29
4659
4658
2022-03-10T11:41:02Z
Rew
3
/* pinout */
wikitext
text/x-wiki
== PWM16 ==
The board comes in two variants, the -b suffix has bigger FETs.
=== specifications ===
* PCA9685 PWM chip.
* Each channel drives a N-channel mosfet.
** Note when switching a load with an N-channel mosfet, the load is wired with its positive directly
connected to power and the mosfet will switch the negative terminal of your load.
* For ease of hooking up, each channel has a power and a switched connection.
The small fets can handle 1A each. Running a total of 16A through the whole board will heat it up a bit, but should still work. Slightly more than 1A is permissible, provided it doesn't last too long. But keep in mind that electronics works on a different timescale. "a second" Is already a very long time for such a small component.
The big fets can handle 5A each. But running 80A through the whole board is going to heat it up beyond permissible limits. Again a bit more for a short period can be permitted, but timescale of "a few milli seconds" and not "a few seconds".
=== pinout ===
Bottom edge has outputs 1-8, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
Top edge has outputs 9-16, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
The right edge of the PCB has 6 connections: GND, V1, V1, GND, V2, V2. The power connections are separate. This alows you to run one side of the PCB at a different voltage than the other side. Say 5V on V2 for the top edge of the board, and 12V for the bottom edge. There are two Vx connectors to make it easy to connect one powersupply by looping a sort wire from the second V1 to V2.
The i2c connector pinout is documented here: https://www.bitwizard.nl/wiki/I2C_connector_pinout
(note that the pin1 (and marking) is closest to the PCA chip).
The J1 jumper block allows you to configure the address of the PCA chip. No jumper is 0, a jumper is 1. A0 is the position closest to the PCA chip, A3 is the furthest.
=== Usage ===
For full documentation see the PCA9685 datasheet.
To initialize:
* set register 0xfe to 5
* set register 0 to 0x20.
Now the chip is initialized and will do about 1500Hz PWM
To set a channel, write 4 bytes to an address 6+ 4*<channel number> . The first two bytes are the turn-on-timestamp. Write 0x00 0x00. The second two are the turn-off-time. So values 0...0x0fff will set the PWM value (low byte first!). The highest value now will still have the output "off" for 1/4096 period. To turn the output fully on, you need to set the "always on" bit, which is in the "turn on" register that we've been setting to zero. So to turn it fully on send 0x00 0x10 0x00 0x00.
OPTIONAL: if you don't understand this, ignore it.
There are different ways to configure the chip. For example, if you want to set five channels to 0x203, 0x405, 0x607, 0x809 and 0xa0b, the above recommendation works, but it loads your powersupply a bit weird. I've chosen the PWM values a bit wonky so that you can see where the differnt parts go: So above would send '''00 00 03 02, 00 00 05 04, 00 00 07 06, 00 00 09 08, 00 00 0b 0a''' (if the channels are consecutive you can send all that in one go!). In this configuration all five loads are loading the powersupply from 000 to 0203 in each PWM period. And none are loading the powersupply from 0a0b to 0fff.
But slightly easier on the power supply would be: '''00 00 03 02''': First channel is on from 000 to 0203. Then '''03 02 08 06''': second channel is on from 0203 to 0608. Then '''08 06 0f 0c''': third channel on from 0608 to 0c0f. Then '''0f 0c 18 04''': the fourth channel wraps around: it is on from 0c0f to 0418! Continue with '''18 04 23 0e''' and now from 000 to 0e23 two loads are loading the powersupply and from 0e23 to 0fff only one: The variation in load on the powersupply is much less. This strategy works very good when the loads are all identical. When the loads are not identical the calculations become more complex.
54aae02be31135d8e48b5ce1ec608f9b6ebd499a
4660
4659
2022-03-10T12:01:11Z
Rew
3
/* pinout */
wikitext
text/x-wiki
== PWM16 ==
The board comes in two variants, the -b suffix has bigger FETs.
=== specifications ===
* PCA9685 PWM chip.
* Each channel drives a N-channel mosfet.
** Note when switching a load with an N-channel mosfet, the load is wired with its positive directly
connected to power and the mosfet will switch the negative terminal of your load.
* For ease of hooking up, each channel has a power and a switched connection.
The small fets can handle 1A each. Running a total of 16A through the whole board will heat it up a bit, but should still work. Slightly more than 1A is permissible, provided it doesn't last too long. But keep in mind that electronics works on a different timescale. "a second" Is already a very long time for such a small component.
The big fets can handle 5A each. But running 80A through the whole board is going to heat it up beyond permissible limits. Again a bit more for a short period can be permitted, but timescale of "a few milli seconds" and not "a few seconds".
=== pinout ===
Bottom edge has outputs 1-8, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
Top edge has outputs 9-16, each with a <output> <V+> . Each is marked as such on the back of the PCB, as the front was full with components.
The right edge of the PCB has 6 connections: GND, V1, V1, GND, V2, V2. The power connections are separate. This alows you to run one side of the PCB at a different voltage than the other side. Say 5V on V2 for the top edge of the board, and 12V for the bottom edge. There are two Vx connectors to make it easy to connect one powersupply by looping a sort wire from the second V1 to V2.
The i2c connector pinout is documented here: https://www.bitwizard.nl/wiki/I2C_connector_pinout
(note that the pin1 (and marking) is closest to the PCA chip).
The J1 jumper block allows you to configure the address of the PCA chip. No jumper is 0, a jumper is 1. A0 is the position closest to the PCA chip, A3 is the furthest.
If your board has a second i2c connector, you can use it to chain multiple boards on one I2C bus. Make sure you configure each board for a different address in that case.
=== Usage ===
For full documentation see the PCA9685 datasheet.
To initialize:
* set register 0xfe to 5
* set register 0 to 0x20.
Now the chip is initialized and will do about 1500Hz PWM
To set a channel, write 4 bytes to an address 6+ 4*<channel number> . The first two bytes are the turn-on-timestamp. Write 0x00 0x00. The second two are the turn-off-time. So values 0...0x0fff will set the PWM value (low byte first!). The highest value now will still have the output "off" for 1/4096 period. To turn the output fully on, you need to set the "always on" bit, which is in the "turn on" register that we've been setting to zero. So to turn it fully on send 0x00 0x10 0x00 0x00.
OPTIONAL: if you don't understand this, ignore it.
There are different ways to configure the chip. For example, if you want to set five channels to 0x203, 0x405, 0x607, 0x809 and 0xa0b, the above recommendation works, but it loads your powersupply a bit weird. I've chosen the PWM values a bit wonky so that you can see where the differnt parts go: So above would send '''00 00 03 02, 00 00 05 04, 00 00 07 06, 00 00 09 08, 00 00 0b 0a''' (if the channels are consecutive you can send all that in one go!). In this configuration all five loads are loading the powersupply from 000 to 0203 in each PWM period. And none are loading the powersupply from 0a0b to 0fff.
But slightly easier on the power supply would be: '''00 00 03 02''': First channel is on from 000 to 0203. Then '''03 02 08 06''': second channel is on from 0203 to 0608. Then '''08 06 0f 0c''': third channel on from 0608 to 0c0f. Then '''0f 0c 18 04''': the fourth channel wraps around: it is on from 0c0f to 0418! Continue with '''18 04 23 0e''' and now from 000 to 0e23 two loads are loading the powersupply and from 0e23 to 0fff only one: The variation in load on the powersupply is much less. This strategy works very good when the loads are all identical. When the loads are not identical the calculations become more complex.
027e51e643f5c2ba1edb9bc8f4596a15ff16221b
Raspberry Relay
0
1708
4656
4131
2021-12-31T15:31:16Z
RonanKeryell
2591
Update C++14 to modern C++ since it is expected to change
wikitext
text/x-wiki
[[File:RPiRelay.jpg|thumb|300px|alt=The Raspberry Relay board|The Raspberry Relay board]]
The Raspberry Relay board makes it possible to control 4 relays using your Raspberry Pi. There are now 3 versions:
* [http://www.bitwizard.nl/shop/raspberry-pi/rpi-relay Raspberry Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=148 Raspberry SPI Relay board]
* [http://www.bitwizard.nl/shop/raspberry-pi?product_id=149 Raspberry Solid State Relay board]
== Overview ==
The Raspberry Relay board can be connected to a Raspberry Pi using the 26-pin GPIO connector. The relays can be controlled using the Raspberry Pi GPIO pins. Optionally, with the old version of the Relay board the Pi can be powered by the micro USB port on the Relay board. This way, the connectors for power, ethernet and USB are on one side. Please note that the polyfuse will be bypassed if the Pi is powered via the Relay board. The polyfuse prevents damage when a short-circuit occurs. If you power your Raspberry Pi with batteries, it is recommended to use the regular power connector, since a short-circuit could damage the battery. The positive side of bypassing the polyfuse is that the board is less sensitive to voltage fluctuations, since the polyfuse induces a 0.2V voltage drop.
== Pinout ==
[[File:RPiRelayPinout.jpg|thumb|300px|alt=Pin numbering|Pin numbering of the Relay Board]]
{| border=1
! Pin 1 !! Pin 2 !! Pin 3 !! Pin 4 !! Pin 5 !! Pin 6 !! Pin 7 !! Pin 8 !! Pin 9 !! Pin 10
|-
| Neutral || Relay 1 out || Neutral || Relay 2 out || Neutral || Relay 3 out || Neutral || Relay 4 out || Neutral || Hot
|}
XXX Please double check by following the traces or [http://www.bitwizard.nl/contact.php contact us]: we changed the pinout around to have the "hot" on the other side. Double check your version! XXX
If you want to switch mains, you should connect the 'Hot' wire to pin 10. In EU countries, this is usually the brown wire. The blue wire is the 'Neutral', and should be connected to pin 9. All other wires should be connected in the same way, so 'Neutral' to 'Neutral' and a 'Hot' wire to a relay output pin.
[[File:Dsc05646_small.jpg|thumb|300px|Example configuration]]
== Usage ==
There are two versions. One controlled by GPIO pins, the other by SPI.
=== GPIO version ===
The module can be controlled with the GPIO pins on the Pi. Set a pin high, the relay will switch on and when the pin is low the relay will switch off. The pins are wired as follows:
{| border=1
! Relay no. !! Pin number (by [http://elinux.org/File:RPi_P1_header.png this] scheme)!! Pin name ([http://elinux.org/File:GPIOs.png Broadcom ref.]) !! Pin name ([http://wiringpi.com/pins/ wiringPi])
|-
| 1 || 11 || GPIO17 || 0
|-
| 2 || 12 || GPIO18 || 1
|-
| 3 || 13 || GPIO21 (rev 1)/GPIO27 (rev 2) || 2
|-
| 4 || 15 || GPIO22 || 3
|}
=== SPI version ===
The module is effectively an "spi DIO", so you control the relays by sending the state of the 4 relays as the low 4 bits to register 0x10 at address 0xa6.
The rpi_spi_relay has a 4-pin jumper block. Put the jumper on the right side, vertically, and the module is connected to the SPI0 bus.
Example using [[Bw_tool]] :
bw_tool -a a6 -W 10:f
will turn on all 4 relays.
The SPI version has a jumper block. The pins 1,2 are marked, 3-4 are not. 1 is topright, 2 is top-left if you have the silkscreen on the board right-side-up. 1(top right) is SPI_CS0, the opposite corner (4, bottom left) is SPI_CS1. These signals can be connected to the other two with a jumper. 3, bottom-right is "board SPI CS". 2 top-left is the embedded processor's reset line. Putting a jumper 1-3 along the right of the jumper block will allow you to access the board using rapsberry pi SPI0 bus. Putting the jumper 1-2 along the top of the jumper block will allow you to flash the onboard processor, should that be needed.
Another modern C++ library and daemon utility for this SPI relay can be found on https://github.com/keryell/BitWizard_SPI_relay
== Examples ==
=== Shell ===
* First, [http://wiringpi.com/download-and-install/ install WiringPi]
* Set the GPIO modes:
gpio mode 0 out
gpio mode 1 out
gpio mode 2 out
gpio mode 3 out
* Enabling a relay:
gpio write X 1
where X is the relay number (0 to 3)
* Disabling a relay:
gpio write X 0
For more information about the gpio utility, see [https://projects.drogon.net/raspberry-pi/wiringpi/the-gpio-utility/ this page]
=== Python ===
* Install the RPi.GPIO Python module:
sudo apt-get install python-rpi.gpio
* start the python interpreter
python
* or create a script
nano gpio.py
* The Python script should look like this:
#!/usr/bin/env python
#import the GPIO library
import RPi.GPIO as GPIO
#select the board mode pin numbering
GPIO.setmode(GPIO.BOARD)
#set the needed GPIO pins as output
GPIO.setup(11, GPIO.OUT) #relay 1
GPIO.setup(12, GPIO.OUT) #relay 2
GPIO.setup(13, GPIO.OUT) #relay 3
GPIO.setup(15, GPIO.OUT) #relay 4
#toggle the relays
GPIO.output(13,True) #Enable relay 3
GPIO.output(11,False) #Disable relay 1
* For more information on the RPi.GPIO module, see [https://pypi.python.org/pypi/RPi.GPIO this page].
== Datasheets ==
2A SSR: [http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf Omron G3MB-202P]
5A: [http://www.parallax.com/sites/default/files/downloads/27115-Single-Relay-Board-Datasheet.pdf Songle SRD-05VDC]
10A: [http://www.omron.com/ecb/products/pdf/en-g5le.pdf Omron G5LE] or [http://www.omron.com/ecb/products/pdf/en-g5la.pdf Omron G5LA]
ccb07b0093310c64ba778a94c98bfd1322e64e61
STM32 development board
0
2191
4657
2022-01-20T14:07:16Z
Rew
3
Created page with "== pinout == === IO voltage === The "VCCIO" voltage can be set with the jumper "5V/3.3V" Note that this is "power for the slave device", it does not imply that the outgoing..."
wikitext
text/x-wiki
== pinout ==
=== IO voltage ===
The "VCCIO" voltage can be set with the jumper "5V/3.3V"
Note that this is "power for the slave device", it does not imply that the outgoing signals will have a 5V level (that's always 3.3V), or that the pins are 5V tolerant.
=== UART ===
(not all pin numbers are typed out fully).
* 1 GND
* PA10 RX
* PA9 TX
* 4 VCCIO
=== I2C1 ===
(not all pin numbers are typed out fully).
* 1 GND
* PB7 SDA
* PB6 SCL
* 4 VCCIO
=== I2C2 ===
(not all pin numbers are typed out fully).
* 1 GND
* PB11 SDA
* PB10 SCL
* 4 VCCIO
=== SPI ===
See elsewhere on this site.
=== SV2 ===
General purpose IO connector.
(not all pin numbers are typed out fully).
* 1 GND
* 2 GND
* 3 PA0
* PA1
* PA2
* PA3
* PA4
* PA5
* PA6
* PA7
* PA8
* PA15
* PB0
* PB1
* PD2
* PB5
* PB8
* PB9
* 19 VCCIO
* 20 VCCIO
=== SV2 ===
General purpose IO connector.
* 1 GND
* 2 GND
* 3 PC0
* 4 PC1
* 5 PC2
* 6 PC3
* 7 PC4
* 8 PC5
* 9 PC6
* 10 PC7
* 11 PC8
* 12 PC9
* 13 PC10
* 14 PC11
* 15 PC12
* 16 PC13
* 17 PC14
* 18 PC15
* 19 VCCIO
* 20 VCCIO
=== SWD ===
* 1 VCC 3.3V
* 2 SWCK PA14
* 3 GND
* 4 SWDAT PA13
* 5 NRST
* 6 BOOT0
a5d542c0c5ba638fb9bd2976211a3eb80b6a67aa
Bridgetimer
0
1992
4661
4211
2023-01-14T15:53:46Z
Rew
3
/* Technical details */
wikitext
text/x-wiki
= Bridgetimer =
== Introduction ==
A bridge tournament consists of a number of rounds and short breaks in between rounds to allow the players to switch tables. The Bridgetimer counts down the time remaining for each round as well as the remaining break time and provides several audiosignals:
* The starting signal of a round, doubling as the ending signal of the break time
* A warning signal indicating the round is about to end
* The ending signal of a round, doubling as the starting signal of the break time
== Features ==
The BitWizard Bridgetimer has several distinctive features:
* Large display
* Visible difference between "remaining round-time" and "remaining break time".
* Different sounds signals for "end-of-round", "Warning, end-of-round is nearing" and "Start of round".
* Five preset programs. Allowing you to quickly change between different settings (e.g. for the beginners-evening where the rounds are longer).
* Easy to use interface for adjustments.
* On-the-fly adjustment of the playing and changeover (break) time.
* Mounting holes on the back enabling you to mount the timer on a wall
[[File:Bridgeklok_EN.png|600 px|]]
== Contents ==
Within the box you will find:
* The Bridgetimer
* A 15V adapter
* An extension cord
Use the Bridgetimer exclusively with the supplied adapter.
If necessary a similar adapter can be used, with the + on the center pin. The voltage should be between 12 and 15V, however no guarantees are made regarding the brightness of the screen when not using the supplied adapter.
== Using the Bridgetimer ==
The Bridgetimer is simple to use. Just plug it in with the supplied adapter, turn it on and it starts running the first program called "P1" at 10 seconds left of "change time". These ten seconds give you time to adjust the break time or to press the '''pause''' button (5) to pause the clock before the first round timer starts.
The timer always starts with program P1 selected. The default settings for all programs are 30 minutes of playing time, a warning signal when 5 minutes of playing time remain and 3 minutes of break time.
A different program may be selected by pressing '''mode''' (2) and subsequently either '''up''' (3) or '''down''' (4) in order to select the desired program.
The Bridgetimer may be paused at any time by pressing the '''pause''' button (5).
If the current break or round time needs to be adjusted at any point this can done by pressing '''up''' (3) or '''down''' (4) to respectively increase or decrease the time by 1 minute.
A warning signal sounds when the end of a round approaches, a different signal sounds at the end of a round, and a third signal sounds when the break time is over and the next round begins.
During break time the leftmost digit of the display will show a single moving segment symbolizing the players walking around. This way the difference between break and playing time can easily be distinguished.
== Creating custom programs ==
To adjust the clock press '''mode'''. Now '''up''' and '''down''' will select the preset-program. The programs show as P1 through P5. Press '''pause''' to start the selected program, or press '''mode''' again to make adjustments to the selected program.
For each program there are three settings: time to play, warning time, and changeover (break) time. Each is adjusted with the '''up''' and '''down''' keys. The changeover time is adjusted with 20 second increments. The other two with 1 minute increments.
Pressing '''mode''' will move to the next option. Any changes are automatically saved.
Unused programs start out at the default of 30 minutes playing, 5 minute warning and 3 minute changeover time.
To adjust the brightness of the numbers, turn off the clock, press and hold the '''pause''' button, and turn the clock on. The display should now show an "I" (from Intensity) as well as the current value. You may adjust (using the '''up''' and '''down''' buttons) from 0 to 99. The default of 33 seems good for normal use. During daytime or outside even brighter might be useful. Each '''up''' or '''down''' keypress adjusts the intensity value by 3 units. The lowest intensities will show a visible flicker in the display. Don't use those.
== Suggestions for use ==
When you turn on the clock it will always start back at P1. The reason is that when for example there are two weekly events that require different settings, starting back up on the old settings guarantees that you will ''always'' start with the wrong settings active. Starting back at P1 all the time means we stand a chance of getting it right some of the time....
If the program that your club uses is always the same, just adjust the default P1 program. You can do this once and then adjust the change time before the first round or the first round itself on each event.
If you share the clock between two events that have different timings, I recommend programming the schedules for those events into P2 and P3. People who are not familiar with the clock will quickly adjust P1 to whatever event is then being played. If you know what you're doing you can even quicker just select the proper program. In my experience P1 gets messed up "by the other players" all the time.
== Changing the volume ==
The volume can be adjusted with the use of a small screwdriver, both flat and cross head screwdrivers may be used. On the back of the Bridgetimer a total of 4 holes can be found, the two uppermost are used to mount the Bridgetimer on a wall, the outermost is used for field upgrades of the firmware. The innermost (closest to the speaker) is used for adjusting the volume.
As the circuit board and the potentiometer are positioned relatively deep within the timer, some effort may be required to locate the potentiometer. In order to prevent short-circuiting it is advised to search for the potentiometer only when the the timer is unpowered.
== Feedback ==
BitWizard is a small company headed by a bridge-playing CEO. When his bridgeclub wanted a new clock we build one.
We're not specializing in "bridge products" and we don't have the money to fund a big requirements interview among a large number of clubs. So we build what WE need and what we think you will find useful. If you feel something could be improved, feel free to let us know, we'll take it into consideration! It is entirely possible that due to a different way of playing a drive, your club has different requirements. We might even be able to help you with the hardware you've already bought in the form of software changes.
As mentioned above, we welcome feature requests. No guarantees can be made that we implement all of them, but we love to hear them.
Features that have already been requested and are currently being implemented are:
* Multiple clocks in master-slave configuration
* Remote control
Also, if you think a device with four big numbers like this is useful in another context, be sure to let us know.
It is entirely possible the hardware is already capable of performing the task and as specified earlier, the installed software can be switched out for something you require. So if you have an idea, let us know.
Feedback may be send to us by e-mail to info@BitWizard.nl .
== Technical details ==
(the geeks may want to read this, the others can safely ignore it).
The initial version of the clock used to run on 15V, but at one point we realized that 12V also worked with the latest components (led segments: The original required 12V for them alone, more modern ones only about 8).
The USB port on the bottom can be used for upgrading the firmware.
The two PCBs inside are identical, only one is populated as the master, the other as the slave. (The slave can sometimes be another, older (or newer) model than the master, this will not affect performance). Future versions might have only one PCB (for ease of assembly) (starting later in 2023 or maybe 2024).
Version 1 of the hardware runs on an at90USB162 processor and has TLC59025 constant current led drivers to drive the segments. The segments are not multiplexed. Version 2 of the hardware has an STM32F072 processor (As of May 2017 Version 2 is still under development). As of 2023 version 3 is under development using an RP2040. As of january 2023 there is exactly one of those (i.e. half of two).
f533c20fd5f058c66cadc7fceb65adeed1a1795a
FT2232H breakout board
0
12
4662
3489
2023-07-26T16:02:11Z
Rew
3
/* Overview */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>ACBUS5</td><td>1</td><td>2</td><td>NC</td></tr>
<tr><td>NC</td><td>3</td><td>4</td><td>NC</td></tr>
<tr><td>ADBUS0</td><td>5</td><td>6</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>7</td><td>8</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>9</td><td>10</td><td>ADBUS5</td></tr>
<tr><td>5V</td><td>11</td><td>12</td><td>GND</td></tr>
<tr><td>ADBUS6</td><td>13</td><td>14</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>15</td><td>16</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>17</td><td>18</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>19</td><td>20</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>21</td><td>22</td><td>ACBUS7</td></tr>
<tr><td>BDBUS0</td><td>23</td><td>24</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>25</td><td>26</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>27</td><td>28</td><td>BDBUS5</td></tr>
<tr><td>3V3</td><td>29</td><td>30</td><td>GND</td></tr>
<tr><td>BDBUS6</td><td>31</td><td>32</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>33</td><td>34</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>35</td><td>36</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>37</td><td>38</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>39</td><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>ADBUS0</td><td>3</td><td>4</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>5</td><td>6</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>7</td><td>8</td><td>ADBUS5</td></tr>
<tr><td>ADBUS6</td><td>9</td><td>10</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>11</td><td>12</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>13</td><td>14</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>15</td><td>16</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>17</td><td>18</td><td>ACBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see J2 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== Future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
97e2c59445bbfcccba6a382bd08e08ff03803def
4663
4662
2023-07-26T16:03:22Z
Rew
3
/* Overview */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
The SV1 connector is designed to be connected to the 40 pin expansion connector of Terasic FPGA boards. This can be done with a standard 40 pin IDE cable, provided that it isn't too long.
40-pin connector SV1 is connected as follows:
<table border=1>
<tr><td>ACBUS5</td><td>1</td><td>2</td><td>NC</td></tr>
<tr><td>NC</td><td>3</td><td>4</td><td>NC</td></tr>
<tr><td>ADBUS0</td><td>5</td><td>6</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>7</td><td>8</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>9</td><td>10</td><td>ADBUS5</td></tr>
<tr><td>5V</td><td>11</td><td>12</td><td>GND</td></tr>
<tr><td>ADBUS6</td><td>13</td><td>14</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>15</td><td>16</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>17</td><td>18</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>19</td><td>20</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>21</td><td>22</td><td>ACBUS7</td></tr>
<tr><td>BDBUS0</td><td>23</td><td>24</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>25</td><td>26</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>27</td><td>28</td><td>BDBUS5</td></tr>
<tr><td>3V3</td><td>29</td><td>30</td><td>GND</td></tr>
<tr><td>BDBUS6</td><td>31</td><td>32</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>33</td><td>34</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>35</td><td>36</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>37</td><td>38</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>39</td><td>40</td><td>BCBUS7</td></tr>
</table>
Connectors SV4 and SV5 are designed to be compatible with the 20-pin IO connectors also found on other BitWizard boards.
20-pin connector SV4 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>ADBUS0</td><td>3</td><td>4</td><td>ADBUS1</td></tr>
<tr><td>ADBUS2</td><td>5</td><td>6</td><td>ADBUS3</td></tr>
<tr><td>ADBUS4</td><td>7</td><td>8</td><td>ADBUS5</td></tr>
<tr><td>ADBUS6</td><td>9</td><td>10</td><td>ADBUS7</td></tr>
<tr><td>ACBUS0</td><td>11</td><td>12</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>13</td><td>14</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>15</td><td>16</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>17</td><td>18</td><td>ACBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
20-pin connector SV5 is connected as follows:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>GND</td></tr>
<tr><td>BDBUS0</td><td>3</td><td>4</td><td>BDBUS1</td></tr>
<tr><td>BDBUS2</td><td>5</td><td>6</td><td>BDBUS3</td></tr>
<tr><td>BDBUS4</td><td>7</td><td>8</td><td>BDBUS5</td></tr>
<tr><td>BDBUS6</td><td>9</td><td>10</td><td>BDBUS7</td></tr>
<tr><td>BCBUS0</td><td>11</td><td>12</td><td>BCBUS1</td></tr>
<tr><td>BCBUS2</td><td>13</td><td>14</td><td>BCBUS3</td></tr>
<tr><td>BCBUS4</td><td>15</td><td>16</td><td>BCBUS5</td></tr>
<tr><td>BCBUS6</td><td>17</td><td>18</td><td>BCBUS7</td></tr>
<tr><td>3V3</td><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* led1 is connected to VCC
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see J2 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== Future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
d803a5792a9a27bf4809bdb87f4a1708d3e8449d
4664
4663
2023-07-26T16:09:38Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
For the SPI connector pinout please see: [[SPI_connector_pinout]]
for the I2C connector pinout please see: [[I2C_connector_pinout]]
The general purpose connector J1 is:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>VCC</td></tr>
<tr><td>ACBUS0</td><td>3</td><td>4</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>5</td><td>6</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>7</td><td>8</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>9</td><td>10</td><td>ACBUS7</td></tr>
</table>
><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* pwr is connected tot the 3.3V of the board.
If the led doesn't light when you expect it to be, then there is something seriously wrong. (or you need to plug it in).
== Jumper settings ==
==== For 2.0 ====
SV2: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see SV3 settings)<br>
SV3: Regulator power source selection<br>
1-2: Powered from USB<br>
2-3: Powered from FPGA board (through 40-pin connector)<br>
==== For 2.1 ====
J1: 3V3 supply selection<br>
1-2: Direct from FPGA board (through 40-pin connector)<br>
2-3: From regulator (see J2 settings)<br>
J2: Regulator power source selection (physical position is the same as in 2.0, only numbering has changed)<br>
1-2: Powered from FPGA board (through 40-pin connector)<br>
2-3: Powered from USB<br>
== Future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
5db102292dad551c15b9264328937c44665bbe99
4665
4664
2023-07-26T16:13:33Z
Rew
3
/* Jumper settings */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
For the SPI connector pinout please see: [[SPI_connector_pinout]]
for the I2C connector pinout please see: [[I2C_connector_pinout]]
The general purpose connector J1 is:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>VCC</td></tr>
<tr><td>ACBUS0</td><td>3</td><td>4</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>5</td><td>6</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>7</td><td>8</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>9</td><td>10</td><td>ACBUS7</td></tr>
</table>
><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* pwr is connected tot the 3.3V of the board.
If the led doesn't light when you expect it to be, then there is something seriously wrong. (or you need to plug it in).
== Jumper settings ==
J5: selection of IO voltage provided on the connectors:
* 1-2 3.3V
* 2-3 5V.
I2CB-EN and I2CA-EN:
To enable I2C (and disable SPI) add a jumper.
== Future hardware enhancements ==
== Changelog ==
2.1
* Renamed SV2 to J1
* Renamed SV3 to J2
* Jumper settings marked on PCB
* Moved center of mounting holes to 3mm from PCB edge
2.0
* Initial public release
21ffaae9895227277c3558ef689c050bbf39a176
4666
4665
2023-07-26T16:14:40Z
Rew
3
/* Changelog */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
For the SPI connector pinout please see: [[SPI_connector_pinout]]
for the I2C connector pinout please see: [[I2C_connector_pinout]]
The general purpose connector J1 is:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>VCC</td></tr>
<tr><td>ACBUS0</td><td>3</td><td>4</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>5</td><td>6</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>7</td><td>8</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>9</td><td>10</td><td>ACBUS7</td></tr>
</table>
><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* pwr is connected tot the 3.3V of the board.
If the led doesn't light when you expect it to be, then there is something seriously wrong. (or you need to plug it in).
== Jumper settings ==
J5: selection of IO voltage provided on the connectors:
* 1-2 3.3V
* 2-3 5V.
I2CB-EN and I2CA-EN:
To enable I2C (and disable SPI) add a jumper.
== Future hardware enhancements ==
== Changelog ==
1.0: initial testing version
1.1: public release.
8317c0b02d87329a6ec52ad913b662662235181b
4667
4666
2023-07-26T16:15:11Z
Rew
3
/* Future hardware enhancements */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
For the SPI connector pinout please see: [[SPI_connector_pinout]]
for the I2C connector pinout please see: [[I2C_connector_pinout]]
The general purpose connector J1 is:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>VCC</td></tr>
<tr><td>ACBUS0</td><td>3</td><td>4</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>5</td><td>6</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>7</td><td>8</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>9</td><td>10</td><td>ACBUS7</td></tr>
</table>
><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* pwr is connected tot the 3.3V of the board.
If the led doesn't light when you expect it to be, then there is something seriously wrong. (or you need to plug it in).
== Jumper settings ==
J5: selection of IO voltage provided on the connectors:
* 1-2 3.3V
* 2-3 5V.
I2CB-EN and I2CA-EN:
To enable I2C (and disable SPI) add a jumper.
== Future hardware enhancements ==
* Consider pullups on the board for I2C operation.
== Changelog ==
1.0: initial testing version
1.1: public release.
cbc611dc4ef9b1a3debd82c6f67f6a2b9c080a4f
4668
4667
2023-07-26T16:15:22Z
Rew
3
/* Changelog */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
For the SPI connector pinout please see: [[SPI_connector_pinout]]
for the I2C connector pinout please see: [[I2C_connector_pinout]]
The general purpose connector J1 is:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>VCC</td></tr>
<tr><td>ACBUS0</td><td>3</td><td>4</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>5</td><td>6</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>7</td><td>8</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>9</td><td>10</td><td>ACBUS7</td></tr>
</table>
><td>19</td><td>20</td><td>3V3</td></tr>
</table>
=== LEDS ===
* pwr is connected tot the 3.3V of the board.
If the led doesn't light when you expect it to be, then there is something seriously wrong. (or you need to plug it in).
== Jumper settings ==
J5: selection of IO voltage provided on the connectors:
* 1-2 3.3V
* 2-3 5V.
I2CB-EN and I2CA-EN:
To enable I2C (and disable SPI) add a jumper.
== Future hardware enhancements ==
* Consider pullups on the board for I2C operation.
== Changelog ==
* 1.0: initial testing version
* 1.1: public release.
2e737143da89aa08bef1d0f714046d1d36042d00
4669
4668
2023-07-26T16:15:49Z
Rew
3
/* Pinout */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
For the SPI connector pinout please see: [[SPI_connector_pinout]]
for the I2C connector pinout please see: [[I2C_connector_pinout]]
The general purpose connector J1 is:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>VCC</td></tr>
<tr><td>ACBUS0</td><td>3</td><td>4</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>5</td><td>6</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>7</td><td>8</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>9</td><td>10</td><td>ACBUS7</td></tr>
</table>
=== LEDS ===
* pwr is connected tot the 3.3V of the board.
If the led doesn't light when you expect it to be, then there is something seriously wrong. (or you need to plug it in).
== Jumper settings ==
J5: selection of IO voltage provided on the connectors:
* 1-2 3.3V
* 2-3 5V.
I2CB-EN and I2CA-EN:
To enable I2C (and disable SPI) add a jumper.
== Future hardware enhancements ==
* Consider pullups on the board for I2C operation.
== Changelog ==
* 1.0: initial testing version
* 1.1: public release.
aeef9b332c18bb1b52655e46c09f5635ff21cf5b
4670
4669
2023-07-26T16:20:40Z
Rew
3
/* Overview */
wikitext
text/x-wiki
= FT2232H breakout board =
This is the documentation page for the FT2232H breakout board.
== Overview ==
The FT2232H breakout board has an USB connector, two 6 pin SPI connectors, two 4 pin I2C connectors and a general purpose connector. Besides that there are two jumpers for enabling the I2C ports, and a selector jumper that allows you to chose between 3.3V or 5V on the IO connectors.
For (high speed) SPI and I2C, the FT2232H "works", but is superceded by the newer FT4222H. You can buy the [https://bitwizard.nl/shop/FT4222h-Breakout-Board BitWizard FT4222H breakout here].
== External resources ==
* [http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT2232H.pdf Datasheet]
* [http://www.ftdichip.com/Products/ICs/FT2232H.htm FTDI product page]
== Pinout ==
For the SPI connector pinout please see: [[SPI_connector_pinout]]
for the I2C connector pinout please see: [[I2C_connector_pinout]]
The general purpose connector J1 is:
<table border=1>
<tr><td>GND</td><td>1</td><td>2</td><td>VCC</td></tr>
<tr><td>ACBUS0</td><td>3</td><td>4</td><td>ACBUS1</td></tr>
<tr><td>ACBUS2</td><td>5</td><td>6</td><td>ACBUS3</td></tr>
<tr><td>ACBUS4</td><td>7</td><td>8</td><td>ACBUS5</td></tr>
<tr><td>ACBUS6</td><td>9</td><td>10</td><td>ACBUS7</td></tr>
</table>
=== LEDS ===
* pwr is connected tot the 3.3V of the board.
If the led doesn't light when you expect it to be, then there is something seriously wrong. (or you need to plug it in).
== Jumper settings ==
J5: selection of IO voltage provided on the connectors:
* 1-2 3.3V
* 2-3 5V.
I2CB-EN and I2CA-EN:
To enable I2C (and disable SPI) add a jumper.
== Future hardware enhancements ==
* Consider pullups on the board for I2C operation.
== Changelog ==
* 1.0: initial testing version
* 1.1: public release.
e779d86855c00c7d7fda2ac7881172c3086254ce
Dmx interface for raspberry pi
0
1968
4675
4674
2023-09-20T19:16:40Z
Rew
3
/* bullseye */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== bullseye ====
It seems that once again the stock OLA distribution has a problem with the uartdmx plugin.
To compile ola from scratch from the github current version first install the dependencies:
sudo apt build-dep ola
then get the sources:
git clone https://github.com/OpenLightingProject/ola.git
Then configure, build and install:
cd ola
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
The build step will take about 20 minutes on a pi4 with a fast SD card. Next I had to add the olad user to the group tty to allow it to write to the device:
sudo adduser olad tty
FYI: A non-working olad will report
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
while a working one will report:
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
Also FYI: I've compared the sources for the "working" distro-ola and the working-from-git and the only changes are documentation-related. Not a single line-of-code was changed between the two versions.
If I've missed a step when you try this, let me know. (also let me know if all this was not necessary on your system, and say your distribution's ola worked).
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
0ad8c12a230fcf7038c7e3f6f9c266e1f4e7c7f4
4677
4675
2023-10-11T15:00:17Z
Rew
3
/* bullseye */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== bullseye ====
It seems that once again the stock OLA distribution has a problem with the uartdmx plugin.
To compile ola from scratch from the github current version first install the dependencies:
Edit /etc/apt/sources.list
nano /etc/apt/sources.list
and remove the # before deb-src, which is probably the third line. Then:
sudo apt build-dep ola
then get the sources:
git clone https://github.com/OpenLightingProject/ola.git
Then configure, build and install:
cd ola
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
The build step will take about 20 minutes on a pi4 with a fast SD card. Next I had to add the olad user to the group tty to allow it to write to the device:
sudo adduser olad tty
FYI: A non-working olad will report
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
while a working one will report:
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
Also FYI: I've compared the sources for the "working" distro-ola and the working-from-git and the only changes are documentation-related. Not a single line-of-code was changed between the two versions.
If I've missed a step when you try this, let me know. (also let me know if all this was not necessary on your system, and say your distribution's ola worked).
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
7f8626727d88b47707ef71dffe77766b336e3434
4678
4677
2023-10-11T17:35:17Z
Rew
3
/* bullseye */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== bullseye ====
It seems that once again the stock OLA distribution has a problem with the uartdmx plugin.
To simplify a few steps I recommend to just install ola from the distribution.
We won't use the actual olad binary, but it arranges a few things that are useful.
First this installs the scripts to have ola start at
system boot. Also this will add the olad user we need to run the daemon under.
We do this before compiling
and installing ola from source so that our freshly compiled ola will overwrite
the system binaries with a working one.
To compile ola from scratch from the github current version first install the dependencies:
If you haven't already done so, edit /etc/apt/sources.list
sudo nano /etc/apt/sources.list
and remove the # before deb-src, which is probably the third and last line. Then:
sudo apt build-dep ola
then get the sources:
git clone https://github.com/OpenLightingProject/ola.git
The ola deamon should run under user "olad". Adding that is simple enough:
sudo adduser --system olad
Then configure, build and install:
cd ola
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
The build step will take about 20 minutes on a pi4 with a fast SD card. (at least,
that's what happened on mine :-) )
Next I had to add the olad user to the group tty to allow it to write to the device:
sudo adduser olad tty
FYI: A non-working olad (the one in the bullseye distribution) will report
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
while a working one will report:
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
Also FYI: The build in bullseye has defines and build flags that result in the baud-rate-setting
code thinking that the calls needed to set the baud rate are not available. In the latest
ola version the conditions that cause the code to think it isn't available have changed a bit
and the "we can't change the baud rate because at compile time the calls weren't available"
code now prints an error message instead of just returning: "couldn't change it for some reason"
resulting in the above "failed to set baud rate" message without further explanation.
If I've missed a step when you try this, let me know.
(also let me know if all this was not necessary on your system, and say your distribution's ola worked.
This hopefully happens in a future debian/raspberry pi OS version).
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
157578f41e47ba5aa38aef64418ca6a1b56308ae
4966
4678
2024-09-10T08:53:57Z
Rew
3
/* Software */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== DMX input on Linux ==
The Unix-derived way of handling tty/uart makes it impossible to do DMX input from userspace. So this option has existed in the hardware for ages, but for Linux there was no software support.
I have recently (september 2024) written a driver for the UART in userspace that will actually do DMX input and deliver the DMX universe as a memory mappable file. From there it is easy to export it say to OLA, and hopefully QLC+.
This is a hardware driver, so it depends on the hardware. I've tested it on raspberry pi 3, and that works. I expect minor changes for other versions. It is not worth my trouble if nobody uses it, so if you need it, please let me know. I'll then make sure it works on YOUR raspberry pi and write some more documentation.
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== bullseye ====
It seems that once again the stock OLA distribution has a problem with the uartdmx plugin.
To simplify a few steps I recommend to just install ola from the distribution.
We won't use the actual olad binary, but it arranges a few things that are useful.
First this installs the scripts to have ola start at
system boot. Also this will add the olad user we need to run the daemon under.
We do this before compiling
and installing ola from source so that our freshly compiled ola will overwrite
the system binaries with a working one.
To compile ola from scratch from the github current version first install the dependencies:
If you haven't already done so, edit /etc/apt/sources.list
sudo nano /etc/apt/sources.list
and remove the # before deb-src, which is probably the third and last line. Then:
sudo apt build-dep ola
then get the sources:
git clone https://github.com/OpenLightingProject/ola.git
The ola deamon should run under user "olad". Adding that is simple enough:
sudo adduser --system olad
Then configure, build and install:
cd ola
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
The build step will take about 20 minutes on a pi4 with a fast SD card. (at least,
that's what happened on mine :-) )
Next I had to add the olad user to the group tty to allow it to write to the device:
sudo adduser olad tty
FYI: A non-working olad (the one in the bullseye distribution) will report
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
while a working one will report:
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
Also FYI: The build in bullseye has defines and build flags that result in the baud-rate-setting
code thinking that the calls needed to set the baud rate are not available. In the latest
ola version the conditions that cause the code to think it isn't available have changed a bit
and the "we can't change the baud rate because at compile time the calls weren't available"
code now prints an error message instead of just returning: "couldn't change it for some reason"
resulting in the above "failed to set baud rate" message without further explanation.
If I've missed a step when you try this, let me know.
(also let me know if all this was not necessary on your system, and say your distribution's ola worked.
This hopefully happens in a future debian/raspberry pi OS version).
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
2c18802bc00f7811ecf93171bc313d1837120602
4967
4966
2024-09-10T18:47:35Z
Rew
3
/* DMX input on Linux */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== DMX input on Linux ==
The Unix-derived way of handling tty/uart makes it impossible to do DMX input from userspace. So this option has existed in the hardware for ages, but for Linux there was no software support for DMX input.
I have recently (september 2024) written a driver for the UART in userspace that will actually do DMX input and deliver the DMX universe as a memory mappable file. From there it is easy to export it say to OLA, and hopefully QLC+.
This is a hardware driver, so it depends on the hardware. I've tested it on raspberry pi 3, and that works. I expect minor changes for other versions. It is not worth my trouble if nobody uses it, so if you need it, please let me know. I'll then make sure it works on YOUR raspberry pi and write some more documentation.
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== bullseye ====
It seems that once again the stock OLA distribution has a problem with the uartdmx plugin.
To simplify a few steps I recommend to just install ola from the distribution.
We won't use the actual olad binary, but it arranges a few things that are useful.
First this installs the scripts to have ola start at
system boot. Also this will add the olad user we need to run the daemon under.
We do this before compiling
and installing ola from source so that our freshly compiled ola will overwrite
the system binaries with a working one.
To compile ola from scratch from the github current version first install the dependencies:
If you haven't already done so, edit /etc/apt/sources.list
sudo nano /etc/apt/sources.list
and remove the # before deb-src, which is probably the third and last line. Then:
sudo apt build-dep ola
then get the sources:
git clone https://github.com/OpenLightingProject/ola.git
The ola deamon should run under user "olad". Adding that is simple enough:
sudo adduser --system olad
Then configure, build and install:
cd ola
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
The build step will take about 20 minutes on a pi4 with a fast SD card. (at least,
that's what happened on mine :-) )
Next I had to add the olad user to the group tty to allow it to write to the device:
sudo adduser olad tty
FYI: A non-working olad (the one in the bullseye distribution) will report
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
while a working one will report:
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
Also FYI: The build in bullseye has defines and build flags that result in the baud-rate-setting
code thinking that the calls needed to set the baud rate are not available. In the latest
ola version the conditions that cause the code to think it isn't available have changed a bit
and the "we can't change the baud rate because at compile time the calls weren't available"
code now prints an error message instead of just returning: "couldn't change it for some reason"
resulting in the above "failed to set baud rate" message without further explanation.
If I've missed a step when you try this, let me know.
(also let me know if all this was not necessary on your system, and say your distribution's ola worked.
This hopefully happens in a future debian/raspberry pi OS version).
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
7dcd12157e3be09a82116c966dde717b511d2945
4968
4967
2025-10-09T14:08:16Z
Rew
3
/* QLC+ */
wikitext
text/x-wiki
= Introduction =
[[File:DMX_case_complete.jpg|thumb|DMX with case]]
The [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi '''DMX interface for raspberry pi'''] allows you to interface a raspberry pi with DMX hardware.
There is also [http://www.bitwizard.nl/shop/DMX-interface-for-Raspberry-pi-with-usb-(FT245RL) a version "with FT245"]. That version adds the option to use your raspberry pi with our board as an Enttec USB Pro compatible device from another computer (raspberry pi or PC, Windows or Linux)
If you select "for pi zero" we give you an extra 40 pin male header and do not solder the matching female header onto our board. You can then chose several configurations yourself. The one I prefer is to have the male headers on the zero on the bottom, and the female on our board on the top. Keep in mind that if you arrange for the pi to stick out from under or above our board, the pinout is going to be wrong. So you can't put the connectors on both boards on top, and then flip one to make the connection.
= Software =
There are several software packages that can be used with your '''DMX interface for Raspberry pi'''.
First there are QLC+ and OLA. These are packages that run on Linux on the raspberry pi and allow you to control a DMX Universe.
Second, there are several packages by Arjan van Vught that use the raspberry pi "bare metal".
See: http://www.raspberrypi-dmx.com/
== DMX input on Linux ==
The Unix-derived way of handling tty/uart makes it impossible to do DMX input from userspace. So this option has existed in the hardware for ages, but for Linux there was no software support for DMX input.
I have recently (september 2024) written a driver for the UART in userspace that will actually do DMX input and deliver the DMX universe as a memory mappable file. From there it is easy to export it say to OLA, and hopefully QLC+.
This is a hardware driver, so it depends on the hardware. I've tested it on raspberry pi 3, and that works. I expect minor changes for other versions. It is not worth my trouble if nobody uses it, so if you need it, please let me know. I'll then make sure it works on YOUR raspberry pi and write some more documentation.
== QLC+ and OLA ==
Don't forget to remove the console and getty from the serial port that the DMX inteface is using.
See: http://elinux.org/RPi_Serial_Connection#Preventing_Linux_using_the_serial_port
=== QLC+ ===
Harold van Hulten wrote a nice "howto". .... link is dead :-( See: http://www.udenix.nl/2016/how_did_i/rpi2dmx/
QLC+ 's home is at: http://www.qlcplus.org
==== our tests ====
To build qlc+ on raspberry pi with support for our board, you need to follow the howto at:
https://github.com/mcallegari/qlcplus/wiki/Linux-build-Qt5
but with one addition:
apt-get install libqt5serialport5-dev
needs to be added after installing the prerequisites. Next, it seems the uart device is disabled by default: edit
plugins/plugins.pro
to remove the hash on the line with "uart" so that it reads:
!macx:!win32:SUBDIRS += uart
Next, you can build and install. Also use raspi-config to disable console output on serial but to enable the hardware. One more thing is to add the disable-bt and uart_clock to config.txt. See elsewhere on this page for the precise instructions.
=== OLA ===
==== bullseye ====
It seems that once again the stock OLA distribution has a problem with the uartdmx plugin.
To simplify a few steps I recommend to just install ola from the distribution.
We won't use the actual olad binary, but it arranges a few things that are useful.
First this installs the scripts to have ola start at
system boot. Also this will add the olad user we need to run the daemon under.
We do this before compiling
and installing ola from source so that our freshly compiled ola will overwrite
the system binaries with a working one.
To compile ola from scratch from the github current version first install the dependencies:
If you haven't already done so, edit /etc/apt/sources.list
sudo nano /etc/apt/sources.list
and remove the # before deb-src, which is probably the third and last line. Then:
sudo apt build-dep ola
then get the sources:
git clone https://github.com/OpenLightingProject/ola.git
The ola deamon should run under user "olad". Adding that is simple enough:
sudo adduser --system olad
Then configure, build and install:
cd ola
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
The build step will take about 20 minutes on a pi4 with a fast SD card. (at least,
that's what happened on mine :-) )
Next I had to add the olad user to the group tty to allow it to write to the device:
sudo adduser olad tty
FYI: A non-working olad (the one in the bullseye distribution) will report
plugins/uartdmx/UartWidget.cpp:180: Failed to set baud rate to 250k
while a working one will report:
plugins/uartdmx/UartDmxThread.cpp:136: Granularity for UART thread is GOOD
Also FYI: The build in bullseye has defines and build flags that result in the baud-rate-setting
code thinking that the calls needed to set the baud rate are not available. In the latest
ola version the conditions that cause the code to think it isn't available have changed a bit
and the "we can't change the baud rate because at compile time the calls weren't available"
code now prints an error message instead of just returning: "couldn't change it for some reason"
resulting in the above "failed to set baud rate" message without further explanation.
If I've missed a step when you try this, let me know.
(also let me know if all this was not necessary on your system, and say your distribution's ola worked.
This hopefully happens in a future debian/raspberry pi OS version).
==== stretch ====
The distribution ola works on Stretch. ''sudo apt-get install ola'' should do the trick.
Don't forget to disable login on the serial port (raspi-config) and to set init-uart-clock in /boot/config.txt. If you forget that last, you will notice that the "native-uart" option is not available when you try to add the universe.
==== Jessie ====
On raspbian jessie installing OLA is easy: ''sudo apt-get install ola'' should do the trick. <s>The downside is however that it doesn't work :-( . </s>
'''update:''' The simple option seems to work now. :-) '''update2:''' Some hints are that it still doesn't work. :-(
Some have reported success by following the howto at: http://www.raspberrypi-dmx.com/raspberry-pi-dmx512-rdm/ola-on-the-raspberry-pi (which boils down to installing ola 0.10.5 instead of 0.10.1.
<span style="color:#808080">
what does work however is:
#sudo apt-get install automake libtool bison flex libcppunit-dev libprotobuf-dev libprotoc-dev protobuf-compiler protobuf-c-compiler uuid-dev libmicrohttpd-dev
sudo apt-get build-dep ola
mkdir ola
cd ola
wget https://github.com/OpenLightingProject/ola/archive/0.10.1.tar.gz
tar xvfz 0.10.1.tar.gz
cd ola-0.10.1
#libtoolize
autoreconf -i
./configure
make -j 5 all
sudo make install
<span style="color:#808080">
There is one little thing about the first two commands here. The first should always work, but if I accidentally missed a package, well.. I missed a package and the build will fail. The second one (with "build-dep" should be more reliable. But before that works, you need to add the sources to your /etc/apt/sources.list file. It's already there, but commented out. Use your favorite editor to do that. (otherwise, try: sudo nano /etc/apt/sources.list )
</span>
==== wheezy ====
On Wheezy, adding
deb http://apt.openlighting.org/raspbian wheezy main
to ''/etc/apt/sources.list'', and then the ''apt-get install ola'' should work.
There are some important hints at: http://opendmx.net/index.php/OLA_Device_Specific_Configuration#UART_native_DMX
==== raspberry pi 3 and pi 4 ====
You need to disable bluetooth to free the "right" uart for use by DMX.
You need to add in /boot/config.txt:
dtoverlay=disable-bt
This has the consequence that we've stolen back the good UART from the bluetooth that's present on the PI3 and PI4.
For reference (in case you have an older installation), it used to be:
dtoverlay=pi3-disable-bt
Otherwise, the wrong UART will be used. The "wrong" uart (=ttyS0) will be connected to the pins that the DMX interface uses. This uart will:
* change baudrate unexpectedly when the CPU feels hot.
* I haven't figured out if it CAN do the required baud rate, and/or how to do that.
On the raspberry pi forums there is talk about re-enabling bluetooth at a lower performance level, so that might be possible, however you'll have to do your own research.
==== all raspberries ====
First you need to disable "other things" on the UART that the DMX board uses.
sudo systemctl disable serial-getty@ttyAMA0.service
and remove "ttyAMA" or "serial0" from /boot/config.txt. (you'll find something like '''console=ttyAMA0,115200''' there, remove that whole '''console=''' entry. Try not to mess up the rest of that line.
Most importantly: add:
init_uart_clock=16000000
to your config.txt file in the /boot directory. In my tests today (2023) I had a different number on my screen when I was doing this. I used 3x more: 48000000. This works as well (on a rpi4).
Next, you need to configure ola to use the native-uart plugin. It should be as easy as clicking on "add universe" on the ola home page. Somehow we often do not see the plugin active. Sometimes clicking on reload plugins helps, other times we need to restart ola to get the plugin to show up.
Locate your ola-uartdmx.conf (on some systems I'm told it is in ''/etc/ola/conf/'', on others ''/var/lib/ola/conf/'', and in some cases: ''/root/.ola/ola-uartdmx.conf'' or ''/home/pi/.ola/ola-uartdmx.conf''. One of the ways to find out is to look at the -c argument on your running olad.). Edit it and set enabled to true, set the correct device (ttyAMA0), and add ''/dev/ttyAMA0-break = 100'' and ''/dev/ttyAMA0-malf = 100'' . It should then look like:
/dev/ttyAMA0-break = 100
/dev/ttyAMA0-malf = 24000
device = /dev/ttyAMA0
enabled = true
Note that the "malf" (mark after last frame) is set to 24 miliseconds. This is due to a problem with OLA: it writes the data and after that waits for the time specified in "malf". It turns out that the kernel will return from the write before the buffer is flushed. So the malf is measured from close to the START of the frame. Thus if you would enter the normal MALF of 100 microseconds, the next break is attempted after only about three characters have been sent. When the kernel then tries to empty the buffer before issuing the BREAK, it waits way too long. We (bitwizard + ola developers) have not been able to figure out an easy fix. So until then saying "24000" gives reasonable performance. (but once the bug has been fixed, you'll need to adjust this configuration parameter)
==== output mode ====
Then set the board to output mode. I would recommend creating a small script (''sudo nano /usr/bin/set_dmx_mode; sudo chmod 755 /usr/bin/set_dmx_mode'') :
#!/bin/sh
# set_dmx_mode
pin=18
gpio=/sys/class/gpio/gpio$pin
if [ $# -lt 1 ] ; then
echo "$0 : on or off?"
exit 1
fi
if [ ! -d $gpio ] ; then
echo $pin > /sys/class/gpio/export
fi
echo out > $gpio/direction
echo $1 > $gpio/value
then calling the script:
sudo /usr/bin/set_dmx_mode 1
I recommend putting that line in /etc/rc.local so that it gets executed at boot time so you don't have to worry about it. (there is an "exit 0" in there, so put it BEFORE that!)
Or you can install the gpio utility from wiringpi. However this now seems unmaintained and hard-to-get and possibly it doesn't even work on modern pi's. But if it works on your pi the following command allows you view the status of all the pins
gpio readall
and to set GPIO 18 (BCM) in output mode
gpio -g mode 18 out
gpio -g write 18 1
also, pin 14 & 15 need to be in the ALT0 mode, if this is not the case use
gpio -g mode 14 alt0
gpio -g mode 15 alt0
Note that the earlier versions of the DMX board have a bug that when the GPIO 18 pin is an input (not driven) it will configure the board as an output. This is not desirable. Newer versions (starting 1.4) will have this "fixed" and the "default" will be "DMX IN" mode.
This does mean that if you want the board to do output, you can get away with forgetting about this gpio18 business if you have an older version. (I just realized ''I'' was getting away with this.... :-) )
= Hardware =
== used hardware pins ==
The DMX harware uses the 3.3V, 5V, GND, RX, TX and GPIO18 signals. Besides that the non-FTDI version breaks out the SPI bus and I2C bus.
== jumper settings ==
The jumper block has three (sensible) jumper positions, they can be either on or off.
(We used to deliver the jumpers on the jumper block in say 1-NC, 3-NC, 4-NC: each of the jumpers on just one pin, not connected to another jumper pin. Nowadays we deliver them loose in the bag.)
Officially the DMX wire is called a bus. Oficially a bus should be terminated at both ends. Most people think of the DMX bus as coming out of our board and then TO the lamps. So most often our board will be at one end of the bus. In that case you should terminate the bus on our board: Jumper 3-4 mounted. Termination at the SENDING side of the bus is less important than on the opposite end. So if you're just sending DMX data with our board, the termination at our board is not that important. Most people don't bother.
Another possible configuration is that you have a few fixtures and then connect to the DMX IN connector on our board, and then another few fixtures on the DMX out. Our board will be in the middle of the bus, and you are then NOT supposed to add a terminator on our board: Do NOT place the 3-4 jumper.
With "short" busses, the termination is less important than with longer busses. What is "short" and what is "long" depends on the dataspeed. For example, for "SATA" 30-50cm is normal, 1m would be long. For DMX a few tens of meters is still "short".
The other two jumper positions should be added and removed in tandem. They provide a pullup/pulldown on the DMX databus so that the signal level is defined even when there is noone driving the bus. This is important when you do RDM. I found documentation that specified pullup on one line and pulldown on the other, but also the other way around. If you have trouble with RDM, add the jumpers. If that doesn't make things better, try using a few jumper wires and wire 1-5 and 2-6. If that works better for you, let us know!
== Case ==
There is a case for raspberry pi with DMX board.
The assembly instructions have a few pictures.
[[Assembling_the_DMX_case]]
27b38e37bcc242db03c1f6ad6c9f595efbd6e466
STM32 development board
0
2191
4676
4657
2023-10-02T09:07:46Z
Rew
3
/* SV2 */
wikitext
text/x-wiki
== pinout ==
=== IO voltage ===
The "VCCIO" voltage can be set with the jumper "5V/3.3V"
Note that this is "power for the slave device", it does not imply that the outgoing signals will have a 5V level (that's always 3.3V), or that the pins are 5V tolerant.
=== UART ===
(not all pin numbers are typed out fully).
* 1 GND
* PA10 RX
* PA9 TX
* 4 VCCIO
=== I2C1 ===
(not all pin numbers are typed out fully).
* 1 GND
* PB7 SDA
* PB6 SCL
* 4 VCCIO
=== I2C2 ===
(not all pin numbers are typed out fully).
* 1 GND
* PB11 SDA
* PB10 SCL
* 4 VCCIO
=== SPI ===
See elsewhere on this site.
=== SV2 ===
General purpose IO connector.
(not all pin numbers are typed out fully).
* 1 GND
* 2 GND
* 3 PA0
* PA1
* PA2
* PA3
* PA4
* PA5
* PA6
* PA7
* PA8
* PA15
* PB0
* PB1
* PD2
* PB5
* PB8
* PB9
* 19 VCCIO
* 20 VCCIO
=== SV3 ===
General purpose IO connector.
* 1 GND
* 2 GND
* 3 PC0
* 4 PC1
* 5 PC2
* 6 PC3
* 7 PC4
* 8 PC5
* 9 PC6
* 10 PC7
* 11 PC8
* 12 PC9
* 13 PC10
* 14 PC11
* 15 PC12
* 16 PC13
* 17 PC14
* 18 PC15
* 19 VCCIO
* 20 VCCIO
=== SWD ===
* 1 VCC 3.3V
* 2 SWCK PA14
* 3 GND
* 4 SWDAT PA13
* 5 NRST
* 6 BOOT0
47e33b67a063b92272c2f74ee13d995dc11e36ec
General I2C protocol
0
621
4679
3694
2023-11-06T12:06:48Z
Rew
3
wikitext
text/x-wiki
BitWizard expansion boards communicate using an I2C protocol.
I2C is a standard protocol, sometimes called "TW" or "TWI" by other manufacturers.
Each I2C slave has its own I2C address. This allows us to daisy chain a large number of boards. The BitWizard I2C boards can be told to use a different I2C address so that you can resolve conflicts if you would otherwise have several devices at one address. Most other commercial products have an I2C address assigned by the manufacturer or a small range that you can configure using strapping pins.
For the pinout of the bitwizard connector: [https://bitwizard.nl/wiki/I2C_connector_pinout look here]
= Timing =
The slaves use an ATTINY44 processor. These have a hardware universal serial interface (USI) module that can be configured as "I2C slave". Many things however have to be processed in software. This means that some time is required between each byte. The hardware of the ATTINY44 will pull the SCL line low while the processing is not finished. If you use a software I2C master, doublecheck that your I2C master supports this feature.
The I2C protocol is specified at 100kHz and 400kHz bit rate. If you lower the pullup resistors a bit and have a short bus, the hardware will probably be able to handle bit rates up to 2MHz. This is not recommended. Use the standard 400kHz.
= Protocol =
To send a sequence of bytes to the slave I2C device, the master starts by creating a START condition: the SDA line goes low while SCL is held high. All slaves are now primed to receive an "address" byte. Next the master sends the address byte.
After this the protocol in theory depends on which slave you are talking to. In practice so far it is convenient to make the slaves talk a similar protocol: the next byte specifies a "register" or "port" address. After this you can send data to that port or register.
If the data can be considered a "data stream" like with the I2C_LCD board, you can call it a "port". If there is just a single value, it is more common to call it a register.
93c2be26715cec4d6171dc0e1964e18dd81c3c45
Bw tool
0
1635
4680
3309
2023-12-05T09:49:25Z
Rew
3
/* Setting up I2C/SPI under Linux */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
The modern way is to do it with raspi-config. Enter raspi-config, select "interface options", select I2C or SPI depending on what you need, and turn it on. After changing this just now, I did not need to reboot to make the setting active.
Below is what raspi-config does behind the scenes, probably updated for later versions of the kernel and the raspberry pi.
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
For example, if you have an I2C module, add:
-I -D /dev/i2c-1
to switch to i2c-mode and specify the correct device.
If you have a rpi_ui plugged onto your raspberry pi, add:
-a 94
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched, so you need -D /dev/i2c-1, while on the first raspberry pi's -D /dev/i2c-0 is redundant as that is the default.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
The option
-S
will scan the bus for bitwizard protocol devices. This only works for SPI devices. Use the i2cdetect command (in the package i2ctools) to scan the I2C bus if you have i2c devices.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<data>:<type>
will write the data to the port at addr, using the datasize specified in "type": b for byte, s for short (16 bits), i for integer (32 bits) and l for long (64 bits) . For example -W 81:1000:s will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
072b6dbae6eccb641f564cd8ba32a2fee644603a
4681
4680
2023-12-05T09:50:39Z
Rew
3
/* Basic Example */
wikitext
text/x-wiki
= Intro =
The bw_tool is meant to provide a basic commandline access to the bitwizard expansion boards. It was written for the Raspberry Pi, but has now been proven to work on other Linux platforms with an spidev device as well.
= Installation/Compiling =
You can download the bw_tool [https://github.com/rewolff/bw_rpi_tools here]. If you are using git just type
''git clone https://github.com/rewolff/bw_rpi_tools.git''
Nowadays the "bw_tool" is the only directory of interest. Go there and build:
''cd bw_rpi_tools/bw_tool; make''
should work fine. If things went smoothly (which they usually do) you can install the binary so that normal users on your rpi can find it:
''make install''
== Setting up I2C/SPI under Linux ==
The modern way is to do it with raspi-config. Enter raspi-config, select "interface options", select I2C or SPI depending on what you need, and turn it on. After changing this just now, I did not need to reboot to make the setting active.
Below is what raspi-config does behind the scenes, probably updated for later versions of the kernel and the raspberry pi.
On Raspberry pi, raspbian, you first need to edit /boot/config.txt . Near the bottom you will find a line that reads:
#dtparam=i2c_arm=on
You need to remove the hashmark so that it becomes:
dtparam=i2c_arm=on
To activate this a reboot is required.
Then you need to make sure that the i2c-dev module is loaded. For testing, type:
modprobe i2c-dev
but to make it permantently add "i2c-dev" to /etc/modules .
= Basic Example =
The simplest invocation:
bw_tool -t "Hello World!"
will display the shown text on an SPI_LCD on the default SPI bus (SPI0). Options modify the defaults.
For example, if you have an I2C module, add:
-I -D /dev/i2c-1
to switch to i2c-mode and specify the correct device.
If you have a rpi_ui plugged onto your raspberry pi, add:
-a 94
So the complete commandline would become:
bw_tool -D /dev/i2c-1 -I -a 94 -t "Hello world!"
= About Permissions =
The above command needs access to the SPI bus. By default Linux does not know if letting users access this bus is going to compromise the system or not. As a result, Linux chooses to only allow the root user access to the SPI or I2C bus by default. So you have the following choices:
* You can run your whole session as root. Run "sudo -i" to gain root access.
* You can issue only the commands that require spi-bus access as root by prefixing them with "sudo". e.g.:
sudo bw_tool -t "Hello World!"
* If you are using I2C only, you could add yourself to the I2C group (assuming your username is "pi") :
sudo gpasswd -a pi i2c
or:
sudo usermod -a -G i2c pi
You only need to run one of these commands once. Afterwards, log out and back in. To verify if the command succeeded, run:
groups
it should return something like:
pi adm dialout cdrom sudo audio video plugdev games users '''i2c'''
* you can change the permissions on the device files:
sudo chmod 666 /dev/spidev*
sudo chmod 666 /dev/i2c-*
Since the "/dev" filesystem is kept in RAM, you will need to do that again, at every boot. You could add those commands to /etc/rc.local to issue them automatically at every boot, but a better way is to use [https://wiki.debian.org/udev| udev] for this. To do that create (as root) the file /etc/udev/rules.d/70-i2cspi.rules with the following contents:
SUBSYSTEM=="spidev", MODE="0666"
SUBSYSTEM=="i2c-dev", MODE="0666"
and reboot. All I2C and SPI devices should now be world writable.
= Options =
== Options Specifying the Device ==
The option
-I
will switch to I2C mode.
The option
-D <device>
will use that device. Specify /dev/spidev0.1 for the second SPI bus on the raspberry pi for example. Or /dev/i2c-1 to specify the second I2C bus. On revision 2 Raspberry Pi's, the I2C buses are switched, so you need -D /dev/i2c-1, while on the first raspberry pi's -D /dev/i2c-0 is redundant as that is the default.
The option
-a <address>
specifies the address of the device to use. Note that BitWizard uses the full 8 bits that are sent to the device. Add one for "read" operation. In some circles, notably I2C, it is customary to specify just those 7 bits. Thus when the I2C_LCD is at the default address of 0x82, i2cdetect will scan it at address 0x41.
The option
-S
will scan the bus for bitwizard protocol devices. This only works for SPI devices. Use the i2cdetect command (in the package i2ctools) to scan the I2C bus if you have i2c devices.
== Identifying the Device ==
To check for a proper connection to the device, one could use the identify command line switch -i. For instance, a Raspberry Pi UI connected via I2C could be checked with
bw_tool -I -D /dev/i2c-0 -a 94 -i
returnes
I2C_rpi_ui 1.6
== Sending Data ==
the option
-t "text"
will send the text to the device, at port zero. The port cannot be changed, but all BitWizard PCBs that have the option of displaying text have the text port at port zero.
The option
-w <addr>:<byte>
will write the byte to the port at addr. For LCD-equipped boards for example -w 12:50 will set the contrast to 0x50.
The option
-W <addr>:<data>:<type>
will write the data to the port at addr, using the datasize specified in "type": b for byte, s for short (16 bits), i for integer (32 bits) and l for long (64 bits) . For example -W 81:1000:s will write the value 0x1000 to the numsamples port on an analog-equipped board.
== Reading Data ==
The option
-R <port>:<datasize>
reads the data at port from the device. Datasize can be 'b' for byte (default), 's' for short (16 bits), or 'i' for a 32-bit integer.
== Finetuning ==
To test sending data to SPI devices, there is the
--hex [byte...]
option. This simply sends the bytes specified, and reports back what was received. Note that BitWizard boards will not send any data until they have been selected, so the first byte received will represent whatever static is found on the bus.
= Known Bugs =
* The identify command returns two garbled characters when used in I2C mode
54f60ad589f403b81fe6a24d0a8fe6f6978de257
Assembling the DMX case
0
1967
4682
4053
2023-12-31T14:59:41Z
Rew
3
/* Included */
wikitext
text/x-wiki
= Assembling the DMX case =
[[File:DMX_case_complete.jpg|600px|DMX case]]
== Included ==
7x M3X6 6+1 screw
4x M2.5x10 screw
4X M2.5X12MM (If we're our of 12mm, we'll send 16mm)
M2.5x4MM spacer
4X M2.5X20MM FF spacer
4X M2.5X6MM screw
=== OLD: ===
Included screws and spacers
10x m3x6
4x m3x12
4x m2.5x10
4x m3x4mm spacer
4x m3x20mm spacer
== Step 1 ==
4x m3x6
4x m3x12
4x m3x4mm spacer
4x m3x20mm spacer
[[File:DMX_case_1.jpg|400px|DMX case - step 1]]
[[File:DMX_case_2.jpg|400px|DMX case - step 1]]
[[File:DMX_case_3.jpg|400px|DMX case - step 1]]
[[File:DMX_case_4.jpg|400px|DMX case - step 1]]
== Step 2 ==
[[File:DMX_case_5.jpg|400px|DMX case - step 2]]
[[File:DMX_case_6.jpg|400px|DMX case - step 2]]
[[File:DMX_case_7.jpg|400px|DMX case - step 2]]
== Step 3 ==
6x m3x6
4x m2.5x10
[[File:DMX_case_8.jpg|400px|DMX case - step 3]]
[[File:DMX_case_9.jpg|400px|DMX case - step 3]]
[[File:DMX_case_10.jpg|400px|DMX case - step 3]]
[[File:DMX_case_11.jpg|400px|DMX case - step 3]]
[[File:DMX_case_12.jpg|400px|DMX case - step 3]]
[[File:DMX_case_13.jpg|400px|DMX case - step 3]]
3984163490bea937497cfdf435f685f17c69eaab
4683
4682
2023-12-31T15:00:57Z
Rew
3
/* Included */
wikitext
text/x-wiki
= Assembling the DMX case =
[[File:DMX_case_complete.jpg|600px|DMX case]]
== Included ==
Included screws and spacers
7x M3X6 6+1 screw
4x M2.5x10 screw
4X M2.5X12MM (If we're our of 12mm, we'll send 16mm)
M2.5x4MM spacer
4X M2.5X20MM FF spacer
4X M2.5X6MM screw
=== OLD: ===
We've switched from M3 sized screws that you have to force through the RPI to M2.5 as was
intended by the RPI people.
10x m3x6
4x m3x12
4x m2.5x10
4x m3x4mm spacer
4x m3x20mm spacer
== Step 1 ==
4x m3x6
4x m3x12
4x m3x4mm spacer
4x m3x20mm spacer
[[File:DMX_case_1.jpg|400px|DMX case - step 1]]
[[File:DMX_case_2.jpg|400px|DMX case - step 1]]
[[File:DMX_case_3.jpg|400px|DMX case - step 1]]
[[File:DMX_case_4.jpg|400px|DMX case - step 1]]
== Step 2 ==
[[File:DMX_case_5.jpg|400px|DMX case - step 2]]
[[File:DMX_case_6.jpg|400px|DMX case - step 2]]
[[File:DMX_case_7.jpg|400px|DMX case - step 2]]
== Step 3 ==
6x m3x6
4x m2.5x10
[[File:DMX_case_8.jpg|400px|DMX case - step 3]]
[[File:DMX_case_9.jpg|400px|DMX case - step 3]]
[[File:DMX_case_10.jpg|400px|DMX case - step 3]]
[[File:DMX_case_11.jpg|400px|DMX case - step 3]]
[[File:DMX_case_12.jpg|400px|DMX case - step 3]]
[[File:DMX_case_13.jpg|400px|DMX case - step 3]]
b439469c641c18425670c0f1c29c0fca1c060902
4684
4683
2023-12-31T15:02:11Z
Rew
3
/* Step 1 */
wikitext
text/x-wiki
= Assembling the DMX case =
[[File:DMX_case_complete.jpg|600px|DMX case]]
== Included ==
Included screws and spacers
7x M3X6 6+1 screw
4x M2.5x10 screw
4X M2.5X12MM (If we're our of 12mm, we'll send 16mm)
M2.5x4MM spacer
4X M2.5X20MM FF spacer
4X M2.5X6MM screw
=== OLD: ===
We've switched from M3 sized screws that you have to force through the RPI to M2.5 as was
intended by the RPI people.
10x m3x6
4x m3x12
4x m2.5x10
4x m3x4mm spacer
4x m3x20mm spacer
== Step 1 ==
4x m2.5x6
4x m2.5x12
4x m2.5x4mm spacer
4x m2.5x20mm spacer
[[File:DMX_case_1.jpg|400px|DMX case - step 1]]
[[File:DMX_case_2.jpg|400px|DMX case - step 1]]
[[File:DMX_case_3.jpg|400px|DMX case - step 1]]
[[File:DMX_case_4.jpg|400px|DMX case - step 1]]
== Step 2 ==
[[File:DMX_case_5.jpg|400px|DMX case - step 2]]
[[File:DMX_case_6.jpg|400px|DMX case - step 2]]
[[File:DMX_case_7.jpg|400px|DMX case - step 2]]
== Step 3 ==
6x m3x6
4x m2.5x10
[[File:DMX_case_8.jpg|400px|DMX case - step 3]]
[[File:DMX_case_9.jpg|400px|DMX case - step 3]]
[[File:DMX_case_10.jpg|400px|DMX case - step 3]]
[[File:DMX_case_11.jpg|400px|DMX case - step 3]]
[[File:DMX_case_12.jpg|400px|DMX case - step 3]]
[[File:DMX_case_13.jpg|400px|DMX case - step 3]]
663af8991c3dc1ad37f7561f2d5c0e937a2f5bd4